Part Number Hot Search : 
E110C PEB2254 9002FC OC22T5A MB381703 E0102AB MC4407A MUR420
Product Description
Full Text Search
 

To Download CS4237B-KQ Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  integrated srs ? 3d sound technology compatible with sound blaster tm , sound blaster pro tm , and windows sound system tm advanced mpc3-compliant input and output mixer enhanced stereo full duplex operation dual type-f dma support industry leading delta-sigma data converters fully plug-and-play isa compatible 3.3 v or 5 v isa bus operation programmable power management hardware master volume control enhanced digital gameport cs9236 wavetable digital audio interface mpu-401 midi interface consumer iec-958 digital output (s/pdif) cs4236/cs4232/cs4231 register compatible general description the cs4237b is a single chip multimedia audio system that provides compatibility with the microsoft windows sound system standard and will run software written to the sound blaster and sound blaster pro interfaces. the cs4237b is fully compliant with microsofts pc 97 and whql audio requirements. the product includes an internal fm synthesizer and plug-and-play external interfaces for wavetable, cd-rom, and modem de- vices. in addition, the cs4237b includes hardware master volume control pins as well as extensive power management and srs 3d sound technology. ordering information: cs4237b-jq 100 pin tqfp, 14x14x1.4mm CS4237B-KQ 100 pin tqfp, 14x14x1.4mm sep 97 ds213pp4 1 cirrus logic, inc. p.o. box 17847, austin, tx 78760 (512) 445 7222 fax: (512) 445 7581 http://www.cirrus.com crystalclear ? advanced audio system with 3d sound this document contains information for a new product. cirrus logic, inc. reserves the right to modify this product without notice. advanced product information copyright ? cirrus logic, inc. 1997 (all rights reserved) gain gain gain gain attn. l/raux1 l/rline l/raux2 l/rmic min s gain oscillator vref sample rate converters gain cmaux2 mout l/rout input mixer output mixer vref refflt xtali xtalo l/rfilt linear m -law a-law adpcm linear m -law a-law adpcm 16 sample fifo 16 sample fifo isa bus interface plug and play codec reg i/f config io irq dma cd-rom, modem, or upper address bits decode logic dack drq irq iochrdy aen iow ior sa<11:0> sd<7:0> fm synthesizer serial shift digital/ analog joystick logic mpu-401 uart with fifos wss sbpro registers synth. interface or hardware volume control peripherals & eeprom interface xiow xior xd<7:0> xa<2:0> joystick midi scs/ up breset sint/ down stereo d/a s/pdif dsp serial port gain dsp serial port cs9236 serial port sa<12:15> (cdrom) (modem) mute wavetable serial port dsp sample rate converters stereo a/d s s loopback monitor attenuation s digital mixer cs4237b
table of contents cs4237b performance specifications 3 general description ................................. 12 isa bus interface............................................. 13 plug and play ............................................... 15 pnp data ......................................................... 16 loading resource data................................... 17 loading firmware patch data......................... 17 the crystal key ............................................... 18 bypassing plug and play................................. 19 hardware configuration data .......................... 20 hostload procedure ......................................... 24 external e 2 prom............................................ 24 windows sound system codec .............. 26 enhanced functions (modes) ........................ 26 fifos ............................................................... 27 wss codec pio register interface ................ 27 dma interface.................................................. 28 sound system codec register interface ........ 29 direct mapped registers (r0-r3) ............... 29 indirect mapped registers (i0-i31) .............. 35 wss extended registers (x0-x25) ............ 48 sound blaster interface........................ 57 mode switching ............................................... 57 sound blaster register interface .................... 57 game port interface ................................. 60 control interface ..................................... 61 control register interface................................ 61 control indirect registers (c0-c8) .................. 65 srs 3d sound overview ................................ 68 hearing basics................................................. 69 the srs 3d stereo process .......................... 69 srs space control ......................................... 69 srs center control......................................... 70 srs mono-to-stereo synthesis....................... 71 consumer iec-958 digital output ................... 71 mpu-401 interface ........................................ 72 mpu-401 register interface ............................ 72 midi uart ...................................................... 73 mpu-401 "uart" mode operation ................. 73 fm synthesizer (internal)............................. 73 external peripheral port...................... 74 synthesizer interface ....................................... 74 cdrom interface ............................................ 75 modem interface.............................................. 76 dsp serial audio data port.................... 76 cs9236 wavetable serial data port ... 78 wss codec software description .......79 calibration ........................................................79 changing sampling rate .................................80 changing audio data formats.........................81 audio data formats .........................................81 dma registers .................................................85 digital loopback...............................................86 timer registers ................................................86 wss codec interrupt .......................................86 error conditions ...............................................87 digital hardware description...............87 bus interface ....................................................87 volume control interface .................................87 crystal/clock ....................................................88 general purpose output pins ..........................88 reset and power down ...................................89 multiplexed pin configuration...........................89 analog hardware description .............90 line-level inputs plus mpc mixer...................90 microphone level inputs ..................................91 mono input .......................................................91 line-level outputs ...........................................92 mono output with mute control .......................92 miscellaneous analog signals..........................92 grounding and layout ..............................92 power supplies.............................................93 adc/dac filter response..........................95 pin descriptions ...........................................97 isa bus interface pins .....................................98 analog inputs ...................................................99 analog outputs.................................................100 midi interface...................................................101 external fm synthesizer interface ...................101 external peripheral port ...................................101 joystick/dsp serial port interface ...................103 cs9236 wavetable serial port interface .........104 cdrom interface.............................................105 volume control.................................................106 miscellaneous ...................................................106 power supplies ................................................107 parameter definitions...............................108 package parameters .................................109 appendix a: e 2 prom typical data ..........110 appendix b: cs4237b differences...........112 cs4237b ds213pp4 windows and windows sound system are registered trademarks of microsoft corporation. sound blaster and sound blaster pro are registered trademarks of creative labs. adlib is a registered trademark of adlib corporation. the word srs and the srs symbol are registered trademarks of srs labs, inc. the cs4237b incorporates the srs (sound retrieval system) under license from srs labs, inc. 2
analog characteristics t a = 25 c; va, vd1, vdf1-vdf4 = +5v input levels: logic 0 = 0v, logic 1 = vd1; 1 khz input sine wave; sample frequency, fs = 44.1 khz; measurement bandwidth is 20 hz to 20 khz - unweighted, 16-bit linear coding.) cs4237b-jq CS4237B-KQ parameter* symbol min typ max min typ max units analog input characteristics - minimum gain setting (0db); unless otherwise specified. adc resolution (note 1) 16 - - 16 - - bits adc differential nonlinearity (note 1) - - 0.5 -- 0.5 lsb instantaneous dynamic range line inputs (note 2) mic inputs idr - - 80 75 - - 80 72 85 79 - - db db total harmonic distortion line inputs mic inputs thd - - 0.05 0.05 - - - - 0.006 0.01 0.02 0.025 % % interchannel isolation line to line inputs line to mic inputs line-to-aux1 line-to-aux2 - - - - 80 80 90 90 - - - - - - - - 80 80 90 90 - - - - db db db db interchannel gain mismatch line inputs mic inputs - - - - 0.5 0.5 - - - - 0.5 0.5 db db programmable input gain span line inputs 21.5 22.5 - 21.5 22.5 - db gain step size 1.3 1.5 1.7 1.3 1.5 1.7 db adc offset error 0 db gain - - - - 10 100 lsb full scale input voltage: (mge=1) mic inputs (mge=0) mic inputs line, aux1, aux2, min inputs 0.26 2.6 2.6 0.28 2.8 2.8 - - - 0.26 2.6 2.6 0.28 2.8 2.8 - - - v pp v pp v pp gain drift - 100 -- 100 - ppm/c input resistance (note 1) mic inputs other inputs 8 20 11 23 - - 8 20 11 23 - - k w k w input capacitance (note 1) - - 15 - - 15 pf notes: 1. this specification is guaranteed by characterization, no production testing. 2. mge = 1 (see wss indirect reg i0, i1). *parameter definitions are given at the end of this data sheet. specifications are subject to change without notice. ds213pp4 cs4237b 3
analog characteristics (continued) cs4237b-jq CS4237B-KQ parameter* symbol min typ max min typ max units analog output characteristics - minimum attenuation (0db); unless otherwise specified. dac resolution (note 1) 16 - - 16 - - bits dac differential nonlinearity (note 1) - - 0.5 -- 0.5 lsb dynamic range -total all outputs -instantaneous tdr idr - - - 85 - - - 80 95 85 - - db total harmonic distortion (note 3) thd - 0.01 - - 0.01 0.02 % interchannel isolation line out (note 3) - 95 - - 95 - db interchannel gain mismatch line out - 0.1 0.5 - 0.1 0.5 db voltage reference output - vref 2.0 2.2 2.5 2.0 2.2 2.5 v voltage reference output current - vref (notes 1,4) - 100 400 - 100 400 m a dac programmable attenuation span 100 106.5 - 100 106.5 - db dac attenuation step size +12 db to -81 db -82.5 db to -94.5 db 1.3 1.0 1.5 1.5 1.7 2 1.3 1.0 1.5 1.5 1.7 2 db db dac offset voltage - - - - 1 10 mv full scale output voltage: out, mout (note 3) 2.6 2.8 3.2 2.6 2.8 3.2 vpp gain drift - 100 - - 100 - ppm/c deviation from linear phase (passband) (note 1) - - 1 - - 1 degree external load impedance (note 1) 10 - - 10 - - k w mute attenuation 80 - - 80 - - db total out-of-band energy 0.6xfs to 100 khz (note 1) ------45db audible out-of-band energy 0.6xfs to 22 khz (fs=8khz) (note 1) ------70db power supply power supply current digital, operating analog, operating total operating total power down - - - - 80 25 105 100 - - - - - - - - 80 25 105 100 91 31 122 400 ma ma ma m a power supply rejection 1 khz (note 1) 40 - - 40 - - db notes: 3. 10 k w , 100 pf load. 4. dc current only. if dynamic loading exists, then the voltage reference output must be buffered or the performance of adcs and dacs will be degraded. ds213pp4 cs4237b 4
recommended operating conditions (agnd, dgnd, sgnd = 0v, all voltages with respect to 0v.) parameter symbol min typ max units power supplies: digital (note 5) digital filtered analog vd1 vdf1-vdf4 va 4.75 3.0 4.75 4.75 5.0 3.3 5.0 5.0 5.25 3.6 5.25 5.25 v v v v operating ambient temperature t a 02570 c note 5. when vd1 is powered from 3.3 volts, all isa bus input pins, except drqa, must also be 3.3 volts. drqa is internally powered from the vdf supply and must have a 5 volt interface. to use drqa in a 3.3 volt application, a level translator is needed. absolute maximum ratings (agnd, dgnd, sgnd = 0v, all voltages with respect to 0v.) parameter symbol min max units power supplies: digital analog vd1 vdf1-vdf4 va -0.3 -0.3 -0.3 6.0 6.0 6.0 v v v total power dissipation (supplies, inputs, outputs) - 1 w input current per pin (except supply pins) -10.0 +10.0 ma output current per pin (except supply pins) -50 +50 ma analog input voltage -0.3 va+0.3 v digital input voltage: sa<11:0>, ior, iow, aen sd<7:0>, dack all other digital inputs -0.3 -0.3 vd1+0.3 vdf+0.3 v v ambient temperature (power applied) -55 +125 c storage temperature -65 +150 c warning: operation beyond these limits may result in permanent damage to the device. normal operation is not guaranteed at these extremes. mixers (t a = 25 c; va, vd1, vdf1-vdf4 = +5v; input levels: logic 0 = 0v, logic 1 = vd1; 1 khz input sine wave, measurement bandwidth is 20 hz to 20 khz - unweighted.) cs4237b-jq CS4237B-KQ parameter* min typ max min typ max units mixer gain range span line, aux1, aux2 mic, min hardware master (digital) wavetable, monitor, pc wave, dsp, fm - - - - - - - - - - - - 45 42 44 90 46.5 45 48 94.4 - - - - db db db db step size mic, line, aux1, aux2 min hardware master (digital) wavetable, monitor, pc wave, dsp, fm - - - - - - - - - - - - 1.3 2.3 1.6 0.9 1.5 3.0 2.0 1.5 1.7 3.7 2.4 2.0 db db db db dynamic range -total (analog mixers) -instantaneous - - - 88 - - - - 94.5 91 - - db db total harmonic distortion (note 3) (analog mixers) - 0.005 - - 0.002 - db ds213pp4 cs4237b 5
digital characteristics (t a = 25c; va, vdf1-vdf4 = 5v, vd1 = 5v/3v; agnd, dgnd1, sgnd1-sgnd4 = 0v.) parameter symbol min max units high-level input voltage digital inputs xtali v ih 2.0 vd-1.0 - - v v low-level input voltage v il -0.8v high-level output voltage: isa bus pins (except drqa) i 0 = -24.0 ma drqa i 0 = -24.0 ma iochrdy, sda/xd0 (note 6) all others i 0 = -1.0 ma v oh 2.4 2.4 2.4 2.4 vd1 vdf vdf vdf v v v v low-level output voltage: isa bus pins i 0 = 24.0 ma i 0 = 18.0 ma iochrdy i 0 = 8.0 ma all others i 0 = 4.0 ma v ol - - - - 0.55 0.4 0.4 0.4 v v v v input leakage current (digital inputs) -10 10 m a output leakage current (high-z digital outputs) -10 10 m a note 6. open collector pins. high level output voltage dependent on external pull up (required) used and number of peripherals (gates) attached. digital filter characteristics (note 1) parameter symbol min typ max units passband 0 - 0.40xfs hz frequency response -1.0 - +0.5 db passband ripple (0-0.40xfs) - - 0.1 db transition band 0.40xfs - 0.60xfs hz stop band 0.60xfs - - hz stop band rejection 74 - - db group delay 8- and 16-bit formats stereo adpcm format mono adpcm format - - - - - - 10/fs 14/fs 18/fs s s s group delay variation vs. frequency adcs dacs - - - - 0.0 0.1/fs m s m s ds213pp4 cs4237b 6
timing parameters (t a = 25 c; va, vd1, vdf1-vdf4 = +5v; outputs loaded with 30pf input levels: logic 0 = 0v, logic 1 = vd1) parameter symbol min max units e 2 prom timing (note 1) scl low to sda data out valid t aa 03.5 m s start condition hold time t hd:sta 4.0 - m s clock low period t lscl 4.7 - m s clock high period t hscl 4.0 - m s start condition setup time (for a repeated start condition) t su:sta 4.7 - m s data in hold time t hd:dat 0- m s data in setup time t su:dat 250 - ns sda and scl rise time (note 7) t r -1 m s sda and scl fall time t f - 300 ns stop condition setup time t su:sto 4.7 - m s data out hold time t dh 0-ns notes 7. rise time on sda is determined by the capacitance of the sda line with all connected gates and the external pullup resistor required. xa0/scl xd0/sda (in) xd0/sda (out) t f t hscl t lscl t r t su:sta t hd:sta t hd:dat t su:dat t su:sto t aa t dh e 2 prom 2-wire interface timing ds213pp4 cs4237b 7
timing parameters (continued) parameter symbol min max units parallel bus timing iow or ior strobe width t stw 90 - ns data valid to iow rising edge (write cycle) t wdsu 22 - ns ior falling edge to data valid (read cycle) t rddv -60ns sa <> and aen setup to ior or iow falling edge t adsu 22 - ns sa <> and aen hold from iow or ior rising edge t adhd 10 - ns dack<> inactive to iow or ior falling edge (dma cycle immediately followed by a non-dma cycle) (note 8) t sudk1 60 - ns dack<> active from iow or ior rising edge (non-dma cycle completion followed by dma cycle) (note 8) t sudk2 0-ns dack<> setup to ior falling edge (dma cycles) dack<> setup to iow falling edge (note 8) t dksua t dksub 25 25 - - ns ns data hold from iow rising edge t dhd2 15 - ns drq<> hold from iow or ior falling edge dtm(i10) = 0 (assumes no more dma cycles needed) dtm(i10) = 1 t drhd - -25 45 - ns time between rising edge of iow or ior to next falling edge of iow or ior t bwdn 80 - ns data hold from ior rising edge t dhd1 025ns dack<> hold from iow rising edge dack<> hold from ior rising edge t dkhda t dkhdb 25 25 - - ns ns resdrv pulse width high (note 1) t resdrv 1-ms initialization time (note 1, 9) t init 130 1200 ms eeprom read time (note 1, 10) t eeprom 1420ms xtal, 16.9344 mhz, frequency (notes 1, 11) 16.92 16.95 mhz xtali high time (notes 1, 11) 24 - ns xtali low time (notes 1, 11) 24 - ns sample frequency (note 1) fs 3.918 50 khz serial port timing sclk rising to sdout valid (note 1) t pd1 -60ns sclk rising to fsync transition (note 1) t pd2 -20 20 ns sdin valid to sclk falling (note 1) t s1 30 - ns sdin hold after sclk falling (note 1) t h1 30 - ns notes: 8. aen must be high during dma cycles. 9. initialization time depends on the power supply circuitry, as well as the the type of clock used. 10. eeprom read time is dependent on amount of data in eeprom. minimum time relates to no eeprom present. maximum time relates to eeprom data size of 2k bytes. 11. the sample frequency specification must not be exceeded. ds213pp4 cs4237b 8
t drhd t dkhdb t dhd1 t rddv t dksua t stw drq<> dack<> sd<7:0> ior 8-bit mono dma read/capture cycle sdin sdout t pd1 t s1 t h1 msb, left sclk t pd2 t pd2 fsync t sckw msb, left t pd2 fsync sf1,0=01,10 sf1,0=00 dsp serial port timing xd0/xa0 eeprom read t resdrv resdrv sd<7:0> codec responds to isa activity t init t eeprom reset timing ds213pp4 cs4237b 9
right/low byte left/low byte t bwdn sd<7:0> drq<> left/high byte right/high byte ior/iow dack<> 16-bit stereo or adpcm dma cycle left/low byte t bwdn sd<7:0> drq<> right/high byte dack<> ior/iow 8-bit stereo or 16-bit mono dma cycle t drhd t stw drq<> dack<> sd<7:0> iow t dksub t dkhda t dhd2 t wdsu 8-bit mono dma write/playback cycle ds213pp4 cs4237b 10
drq<> sd<7:0> sa<> t adsu t adhd t sudk1 t sudk2 t dhd2 t wdsu t stw iow dack<> aen i/o write cycle drq<> sd<7:0> sa<> t dhd1 t rddv t adsu t adhd t sudk1 t sudk2 ior dack<> aen i/o read cycle ds213pp4 cs4237b 11
general description this device is comprised of six physical devices along with plug-and-play support for two addi- tional external devices. the internal devices are: windows sound system codec sound blaster pro compatible interface game port (joystick) control mpu-401 fm synthesizer the two external devices are: ide cdrom modem a full isa interface with plug and play compati- bility and an external peripheral port for interfacing to external devices (i.e. wave-table synthesizer, cdrom, and modem) is included. since the wave-table synthesizer and cdrom analog inputs are external, mapping as shown in figure 5, on page 58, must be used to maintain sound blaster compatibility, i.e. cdrom analog must be connected to the aux2 analog inputs of the mixer. on power up, this part requires a resdrv sig- nal to initialize the internal configuration. when initially powered up, the part is isolated from the bus, and each device supported by the part must be activated via software. once activated, each device responds to the resources given (address, irq, and dma channels). the eight devices listed above are grouped into six logical devices, as shown in figure 1 (bracketed features are sup- ported, but typically not used). the six logical devices are: logical device 0: windows sound system codec (wss codec) adlib/sound blaster-compatible synthesizer sound blaster pro compatible interface logical device 1: game port logical device 2: control logical device 3: mpu401 logical device 4: cdrom logical device 5: modem logical device 0 consists of three physical de- vices. the wss codec and the synthesizer are grouped together since the original windows sound system board expected an fm synthesizer if the codec was present. the sound blaster pro compatible interface, sbpro, is also grouped to allow the wss codec and the sbpro to share interrupts and dma channels. the synthesizer device could be the internal fm synthesizer, or a synthesizer externally located on the peripheral port. the external synthesizer interface supports both fm and wavetable synthesizers such as the cs9233. the wss codec, fm synthesizer, and the sbpro compatible devices are internal to the part. logical device 1 is the game port that supports up to two joystick devices. logical device 2 is the control device that sup- ports global features of the part. this device uses i/o locations to control power management, joystick rate, and pnp resource data loading. logical device 3 is the mpu-401 interface. the mpu-401 midi interface includes a 16-byte fifo for data transmitted out the midout pin and a 16-byte fifo for data received from the midin pin. logical device 4 supports an ide cdrom con- nected to the peripheral port. this interface, on the external peripheral port, can support cdroms with up to 8 i/o locations and sup- ports both the base address and the alternate base address, an interrupt, and a dma channel. al- though this logical device is listed as a cdrom, any external device that fits within the resources listed above may be substituted. ds213pp4 cs4237b 12
logical device 5 supports a modem connected to the peripheral port. this interface, on the ex- ternal peripheral port, supports modems with 2 to 256 i/o locations (only sa2-sa0 are buffered through the part) and supports a base address and an interrupt. although this logical device is listed as a modem, any external device that fits within the resources listed above may be substi- tuted. isa bus interface the 8-bit parallel i/o and 8-bit parallel dma ports provide an interface which is compatible with the industry standard architecture (isa) bus. the isa interface enables the host to com- municate with the various functional blocks within the part via two types of accesses: pro- grammed i/o (pio) access, and dma access. a number of configuration registers must be pro- grammed prior to any accesses by the host computer. the configuration registers are pro- grammed via a plug-and-play configuration sequence or via configuration software provided by crystal semiconductor. i/o cycles every device that is enabled, requires i/o space. an i/o cycle begins when the part decodes a valid address on the bus while the dma ac- knowledge signals are inactive and aen is low. the ior and iow signals determine the direc- tion of the data transfer. for read cycles, the part will drive data on the sd<7:0> lines while the host asserts the ior strobe. write cycles require the host to assert data on the sd<7:0> lines and strobe the iow signal. data is latched on the ris- ing edge of the iow strobe. pnp isa bus interface wss codec: i/o: wssbase 2 dma chan. 1 interrupt sbpro: i/o: sbbase (dma shared) (interrupt shared) synthesis: i/o: synbase [1 interrupt] game port: i/o: gamebase control: i/o: ctrlbase [1 interrupt] mpu-401: i/o: mpubase 1 interrupt cdrom: i/o: cdbase acdbase [1 interrupt] [1 dma chan.] logical device 0 logical device 1 logical device 3 modem: i/o: combase [1 interrupt] logical device 4 logical device 5 logical device 2 figure 1. logical devices ds213pp4 cs4237b 13
i/o address decoding the logical devices use 10-bit or 12-bit address decoding. the synthesizer, sound blaster, game port, mpu-401, cdrom, and modem devices support 10-bit address decoding, while the win- dows sound system and control devices support 12-bit address decoding. devices that support 10-bit address decoding, require a10 and a11 be zero for proper decode; therefore, no aliasing oc- curs through the 12-bit address space. to prevent aliasing into the upper address space, a "16-bit decode" option may be used, where the upper address bits sa12 through sa15 are con- nected to the part. sa12-sa15 are then decoded to be 0,0,0,0 for all logical device address de- coding. when the upper address bits are used, the cdrom and modem interfaces are no longer available since the upper address pins are multiplexed with the cdrom and modem inter- faces (see reset and power down section). if the cdrom or modem is needed, the circuit shown in figure 2 can replace the sa12 through sa15 pins and provide the same functionality. four cascaded or gates, using a 74als32, can replace the als138 in figure 2, but causes a greater delay in address decoding. dma cycles the part supports up to three 8-bit isa-compat- ible dma channels. the default hardware connections, which can be changed through the hardware configuration data, are: dma a = isa dma channel 0 dma b = isa dma channel 1 dma c = isa dma channel 3 the typical configuration would require two dma channels. one for the wss codec and sound blaster playback, and the other for wss codec capture (to support full-duplex). the cdrom, if used, can also support a dma chan- nel, although this is not typical. dma cycles are distinguished from control reg- ister cycles by the generation of a drq (dma request). the host acknowledges the request by generating a dack (dma acknowledge) sig- nal. the transfer of audio data occurs during the dack cycle. during the dack cycle the ad- dress lines are ignored. the digital audio data interface uses dma re- quest/grant pins to transfer the digital audio data between the part and the isa bus. upon receipt of a dma request, the host processor responds with an acknowledge signal and a command strobe which transfers data to and from the part, eight bits at a time. the request pin stays active until the appropriate number of 8-bit cycles have occurred. the number of 8-bit transfers will vary depending on the digital audio data format, bit resolution, and operation mode. the dma request signal can be asserted at any time. once asserted, the dma request will re- main asserted until a complete dma cycle occurs. a complete dma cycle consists of one or more bytes depending on which device inter- nal to the part is generating the request. sa12 sa13 sa14 sa15 aen +5v 1 4 c b a 3 2 15 g1 6 g2b g2a 5 y0 y6 y5 y4 y3 y2 y1 y7 74als138 aen isa bus figure 2. 16-bit decode circuit ds213pp4 cs4237b 14
interrupts for plug-and-play flexibility, six interrupt pins are supported, although only one or two are typi- cally used. the default hardware connections, which can be modified through the hardware configuration data, are: irq a = isa interrupt 5 irq b = isa interrupt 7 irq c = isa interrupt 9 irq d = isa interrupt 11 irq e = isa interrupt 12 irq f = isa interrupt 15 the typical configuration would support two in- terrupt sources: one shared between the wss codec and the sound blaster pro compatible de- vices, and the other for the mpu401 device. interrupts are also supported for the synthesizer, control, cdrom devices, but are typically not used. if the modem logical device (ld5) is used, it would typically support an interrupt. plug and play the plug-and-play (pnp) interface logic is com- patible with the intel/microsoft plug-and-play specification, version 1.0a, for an isa-bus de- vice. since the part is an isa-bus device, it only supports isa-compatible irqs and dma chan- nels. plug and play compatibility allows the pc to automatically configure the part into the sys- tem upon power up. plug and play capability optimally resolves conflicts between plug and play and non-plug and play devices within the system. alternatively, the pnp feature can be by- passed. see the bypassing pnp section for more information. for a detailed plug-and-play proto- col description, please refer to the plug and play isa specification . to support plug-and-play in isa systems that do not have a pnp bios or a pnp-aware operating system, the configuration manager (cm) tsr and an isa configuration utility (icu) from in- tel corp. are used to provide these functions. the cm isolates the cards, assigns card select numbers, reads pnp card resource requirements, and allocates resources to the cards based on system resource availability. the icu is used to keep the bios and the cm informed of the cur- rent system configuration. it also aids users in determining configurations for non-pnp isa cards. a more thorough discussion of the con- figuration manager and the isa configuration utility can be found in the product development information document of the plug and play kit by intel corp. in a pnp bios system, the bios is responsible for configuring at least all system board pnp devices. some systems require addi- tional software to aid the bios in configuring pnp isa cards. the pnp bios can execute all pnp functions independently of the type of oper- ating system. however, if a pnp aware operating system is present, the pnp responsibilities are shared between the bios and the operating sys- tem. for more information regarding pnp bios, please refer to the latest revision of the plug and play bios specification published by compaq computer, phoenix technologies, and intel. the plug and play configuration sequence maps the various functional blocks of the part (logical devices) into the host system address space and configures both the dma and interrupt channels. the host has access to the part via three 8-bit auto-configuration ports: address port (0279h), write data port (0a79h), and relocatable read data port (020bh - 03ffh). the read data port is relocated automatically by pnp software when a conflict occurs. the configuration sequence is as follows: 1. host sends a software key which places all pnp cards in the sleep state (or plug-and- play mode). 2. the crystal part is isolated from the system using an isolation sequence. ds213pp4 cs4237b 15
3. a unique identifier (handle) is assigned to the part and the resource data is read. 4. after all cards resource requirements are de- termined, the host uses the handle to assign conflict-free resources 5. after the configuration registers have been programmed, each configured logical device is activated. 6. the part is then removed from plug-and-play mode. upon power-up, the chip is inactive and must be enabled via software. the crystal part monitors writes to the pnp auto-configuration address port (0279h). if the host sends a pnp initiation key, consisting of a series of 32 predefined byte writes, the hardware will detect the key and place the part into the plug-and-play (pnp) mode. another method to program the part is to use a special crystal initiation key which func- tions like the pnp initiation key, but can be invoked by the user at any time. however, the crystal key only supports one crystal part per system. the crystal key and special commands are detailed in the crystal key and bypassing pnp sections. the isolation sequence uses a unique 72-bit se- rial identifier. the host performs 72 pairs of i/o read accesses to the read data port. the identi- fier determines what data is put on the data bus in response to those read accesses. when the iso- lation sequence is complete, the cm assigns a card select number (csn) to the part. this number distinguishes the crystal part from the other pnp devices in the system. the configura- tion manager (cm) then reads the resource data from the crystal part. the 72-bit identifier and the resource data is either stored in an external user-programmable e 2 prom, or loaded via a "hostload" procedure from bios before pnp software is initiated. the cm determines the necessary resource re- quirements for the system and then programs the part through the configuration registers. the con- figuration register data is written one logical device at a time. after all logical devices have been configured, cm activates each device indi- vidually. each logical device is now available on the isa bus and responds to the programmed address range, dma channels, and interrupts that have been allocated to that logical device. pnp data hardware configuration and plug-and-play re- source data must be loaded into the parts ram. the data may be stored in an external e 2 prom or may be downloaded from the host. to load the data, refer to the loading resource data section. the following is the plug-and-play resource data: the first nine bytes of the pnp resource data are the plug-and-play id, which uniquely identifies the crystal part from other pnp devices. the crystal default is broken down as follows: 0eh, 63h - crystal id - csc in compressed ascii. (see the pnp spec for more information) 42h - oem id. a unique oem id must be ob- tained from crystal for each unique crystal product used. 37h - crystal product id for the cs4237b ffh, ffh, ffh, ffh - serial number. this can be modified by each oem to uniquely identify their card. ??h - checksum. of the 9-byte serial number listed above, crystal software uses the first two bytes to indicate the presence of a crystal part, and the fourth byte, 0x37, to indicate the cs4237b; therefore, these three bytes must not be altered. ds213pp4 cs4237b 16
the next 3 bytes are the pnp version number. the default is version 1.0a: 0ah, 10h, 01h. the next sequence of bytes are the ansi identi- fier string. the default is: 82h, 0eh, 00h, crystal codec, 00h. the logical device data must be entered using the pnp isa specification format. typical logical device values are found in table 1. the e 2 prom version for this data is found in ap- pendix a. loading resource data a serial e 2 prom interface allows user-program- mable serial number and resource data to be stored in an external e 2 prom. the interface is compatible with devices from a number of ven- dors and the size may vary according to specific customer requirements. the maximum size for resource data supported by the parts internal ram is 384 bytes of combined hardware con- figuration and pnp resource data. with the addition of the 4-byte header, the maximum amount of e 2 prom space used would be 388 bytes. however, the part also supports firmware upgrades via the e 2 prom. the maximum size e 2 prom supported is 2k bytes. after power-up, the existence of an e 2 prom is checked by read- ing the first two bytes from the e 2 prom interface. if the data from the e 2 prom port reads 55h and bbh, then the rest of the e 2 prom data is loaded into the internal ram. if the first two bytes arent correct, the e 2 prom is assumed not to exist and a "hostload" proce- dure must be used to load the internal ram. the hostload procedure can be found in the hostload section. for motherboard designs, an e 2 prom should still be included, to allow faster integrat- ing of resource and firmware patch data. this allows updates without respiring bios code. if the part is installed on a plug-in card, then an external e 2 prom is required to ensure that the proper pnp resource data is loaded into the inter- nal ram prior to a pnp sequence. see the external e 2 prom section for more information on the serial e 2 prom interface and e 2 prom programming. the format for the data stored in the e 2 prom is as follows: (hardware configuration data:) 2 bytes e 2 prom validation: 55h, bbh 2 bytes length of resource data in e 2 prom 19 bytes hardware configuration (plug and play resource data:) 9 bytes plug and play id 3 bytes plug and play version number variable number of bytes of user defined ascii id string logical device 0 (windows sound system, fm synthesizer, sound blaster pro) data logical device 1 ( game port) data logical device 2 ( control) data logical device 3 ( mpu-401) data logical device 4 ( cd-rom) data logical device 5 (modem) data end of resource byte & checksum byte firmware patch code. a typical e 2 prom data load, in assembly for- mat, can be found in appendix a. loading firmware patch data an external e 2 prom is read during the power- up sequence that stores hardware configuration and pnp data, and firmware patch data. the part contains ram and rom to run the core proces- ds213pp4 cs4237b 17
sor. the ram allows updates to the core proces- sor functionality. placing the firmware patches in e 2 prom, gives the maximum functionality at power-up without the need for a software driver. the firmware patch data is typically included at the end of the pnp resource data. crystal pro- vides a utility that will read in patch data from a file, and append it to the pnp resource data. the patch file must be obtained from crystal. the crystal key note: the crystal key cannot differentiate be- tween multiple crystal codecs in a system; therefore, only one crystal part is allowed in systems using the crystal key. to allow multiple parts in a system, the plug-and-play isolation se- quence must be used since it supports multiple parts via the serial identifier used in the isolation sequence. physical device logical device best choice acceptable choice 1 sub optimal choice 1 sub optimal choice 2 wss 0 ansi id = wss/sb 16-bit address decode wssbase length/alignment 534h-534h 4/4 534-608h 4/d4h 534-ffch 4/4 high true edge sensitive irq 5 (sb share) 5,7,9,11,12,15 (sb share) 5, 7, 9, 11, 12, 15 (sb share) 8-bit, count by byte, type a dma 1 (sb share) 0, 3 (sb share) 0, 1, 3 (sb share) same dma 0, 3 0, 1, 3 ---- synthesis 0 16-bit address decode synbase length/alignment 388h 4/8 388h 4/8 388-3f8h 4/8 irq ---- ---- ---- sb pro 0 16-bit address decode sbbase length/alignment 220h 16/16 220-260h 16/32 220-300h 16/32 game port 1 ansi id = game 16-bit address decode gamebase length/alignment 200h 8/8 208h 8/8 control 2 ansi id = ctrl 16-bit address decode ctrlbase length/alignment 120-3f8h 8/8 irq ---- mpu401 3 ansi id = mpu 16-bit address decode mpubase length/alignment 330h 2/8 330-360h 2/8 330-3e0h 2/8 irq 9 9,11,12,15 ---- ---- feature not supported in the listed configuration, but is supported through customization. table 1. typical motherboard plug-and-play resource data ds213pp4 cs4237b 18
the crystal key places the part in the configura- tion mode. once the crystal key has been initiated, new pnp resource data can be down- loaded by a hostload sequence, or an alternate method of programming the configuration regis- ters may be used. this alternate method is referred to as the "slam" method. the slam method allows the user to directly access the configuration registers, configure, and activate the chip, and then, optionally, disable the pnp and/or crystal key feature. the slam method uses commands that are similar to the pnp com- mands; however, they are different since the user has direct access to the configuration registers. to use the slam method, see the bypassing pnp section. the following 32 bytes, in hex, are the crystal key: 96, 35, 9a, cd, e6, f3, 79, bc, 5e, af, 57, 2b, 15, 8a, c5, e2 f1, f8, 7c, 3e, 9f, 4f, 27, 13, 09, 84, 42, a1, d0, 68, 34, 1a bypassing plug and play the slam method allows the user to bypass the plug and play features and, as an option, allows the part to act like a non-plug and play or legacy device; however, the slam method only sup- ports one crystal ic per system. the user directly programs the resources into the part, and then optionally disables the pnp and/or the crys- tal key, which forces the part to disregard any future pnp or crystal initiation key sequences (all activated logical devices appear as legacy devices to pnp). the crystal and pnp keys can also be disabled through the e 2 prom. to use the slam method, the following se- quence must be followed: 1. host sends 32-byte crystal key to i/o 0279h, chip enters configuration mode. 2. host programs csn (card select number) by writing a 06h and 00h to i/o 0279h. 3. host programs the configuration registers of each logical device by writing to i/o 0279h. the following data is the maximum amount of information per device. all current devices only need a subset of this data: logical device id (15h, xxh) xxh is logical device number: 0-5 i/o port base address 0 (47h, xxh, xxh) high byte , low byte i/o port base address 1 (48h, xxh, xxh) high byte , low byte i/o port base address 2 (42h, xxh, xxh) high byte , low byte interrupt select 0 (22h, xxh) interrupt select 1 (27h, xxh) dma select 0 (2ah, xxh) dma select 1 (25h, xxh) activate device (33h, 01h) (33h, 00h deactivates a device) 4. repeat #3 for each logical device to be en- abled. (not all devices need be enabled.) 5. host activates chip by writing a 79h to 279h. 6. (optional) host disables pnp key by writing a 55h to ctrlbase+5. the part will not par- ticipate in any future pnp cycles. the crystal key can also be disabled by writing a 56h to ctrlbase+5. ds213pp4 cs4237b 19
note: to enable the pnp/crystal keys after they have been disabled by the slam method, bring the resdrv pin to a logic high or remove power from the device. the following illustrates typical data sent using the slam method. 006h, 001h ; csn=1 015h, 000h ; logical device 0 047h, 005h, 034h ; wssbase = 0x534 048h, 003h, 088h ; synbase = 0x388 042h, 002h, 020h ; sbbase = 0x220 022h, 005h ; wss & sb irq = 5 02ah, 001h ; wss & sb dma0 = 1 025h, 003h ; wss capture dma1 = 3 033h, 001h ; activate logical device 0 015h, 001h ; logical device 1 047h, 002h, 000h ; gamebase = 0x200 033h, 001h ; activate logical device 1 015h, 002h ; logical device 2 047h, 001h, 020h ; ctrlbase = 0x120 033h, 001h ; activate logical device 2 015h, 003h ; logical device 3 047h, 003h, 030h ; mpubase=0x330 022h, 009h ; mpu irq = 9 033h, 001h ; activate logical device 3 079h ; activate crystal device if all the above data is sent, after the crystal key, all devices except the cdrom and modem will respond to the appropriate resources given. hardware configuration data the hardware configuration data contains map- ping information that links interrupt and dma pins with actual interrupt numbers used by pnp and slam procedures. this data also controls the xctl0/xa2 pin functionality. the hard- ware configuration data precedes the pnp resource data. the hardware configuration data is either 19 or 23 bytes long and contains the data necessary to configure the part. if an e 2 prom is not used (hostload), the first four bytes are not needed, which means the configuration data is only 19 bytes long. the configuration data maps the many functions of the logical devices to the physical pins of the chip. table 2 lists the hard- ware configuration bytes. the detailed bit descriptions for each byte follows below. hw config. byte 5: acdbase address length mask, default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 res res res res res cm2 cm1 cm0 cm2-cm0 address bit masks for the alternate cdrom address decode, acdbase. see the cdrom interface section for more details on acdbase 000 - acdcs low for 1 byte 001 - acdcs low for 2 bytes 011 - acdcs low for 4 bytes 111 - acdcs low for 8 bytes xxx - all others, reserved ds213pp4 cs4237b 20
byte default description 155h e 2 prom validation byte 1. the first two bytes tell the crystal codec that the e 2 prom exists. 2 bbh e 2 prom validation byte 2 3 00h high byte for length of resource data in e 2 prom 4 ddh low byte for length of resource data in e 2 prom 5 00h alternate cdrom (logical device 4), acdbase, address length mask 6 03h modem (logical device 5), combase, address length mask 7 80h misc. configuration bits: interrupt pin polarities, key disables, vcen, & ld4 features 8 00h global configuration bits: ifm, vcf1 and vcf0, wten, sps 9 0bh code base byte - must be 0x0b 10* 20h reserved - must be 0x20 11* 04h reserved - must be 0x04 12* 08h reserved - must be 0x08 13* 10h reserved - must be 0x10 14* 80h reserved - must be 0x80 15* 00h reserved - must be 0x00 16* 00h reserved - must be 0x00 17 00h external peripheral port i/o decode address length 00 = 4 bytes, 08 = 8 bytes 08h causes xctl0/xa2 pin to change to peripheral port address bit xa2. 18* 48h reserved - must be 0x48 19 75h irq a/b selection: lower nibble = a, upper nibble = b. along with next two bytes - specify hardware interrupts tied to irqa-irqf pins 20 b9h irq c/d selection: lower nibble = c, upper nibble = d. 21 fch irq e/f selection: lower nibble = e, upper nibble = f. 22 10h dma a/b selection: lower nibble = a, upper nibble = b. this byte and the next byte - specify hardware drq/dacks tied to the dmaa-dmac pins 23 03h dma c selection: lower nibble = c, upper nibble = reserved (must be 0). note:the first four bytes are exclusive to the e 2 prom and are not used in the hostload mode. * currently not supported. must be set to default values given in the table. table 2. hardware configuration data ds213pp4 cs4237b 21
hw config. byte 6: combase address length mask, default = 00000011 d7 d6 d5 d4 d3 d2 d1 d0 mm7 mm6 mm5 mm4 mm3 mm2 mm1 mm0 mm7-mm0 address bit masks for logical device 5, typically a modem address, combase. see the modem interface section for more details on combase. 00000000 - mcs low for 1 byte 00000001 - mcs low for 2 bytes 00000011 - mcs low for 4 bytes 00000111 - mcs low for 8 bytes 00001111 - mcs low for 16 bytes 00011111 - mcs low for 32 bytes 00111111 - mcs low for 64 bytes 01111111 - mcs low for 128 bytes 11111111 - mcs low for 256 bytes xxxxxxxx - all others, reserved note: the part only buffers the lower three address bits onto the peripheral port. when setting the ad- dress decode greater than 8 bytes, the upper address bits should be buffered externally. hw config. byte 7: misc. configuration bits, default = 10000000 d7 d6 d5 d4 d3 d2 d1 d0 ihcd ihs pkd ckd ihm vcen sdd acdb7d acdb7d alternate cdrom, data bit 7 disable. when set, sd7 is held in a high impedance state when reading from acdbase+1 (only this one address). this bit provides support for ide al- ternate base address sharing with the floppy disk controller. sdd sd disable. when set, sd<7:0> are high impedance on reads from any peripheral port address: external syn- thesis, cdrom or modem devices. allows external buffers to bypass the part while still allowing pnp address support. this bit is also internally forced on whenever wten or sps in hw config. byte 8, or c8, is set. vcen volume control enable. when set, the up, down, and mute pins be- come active and provide a hardware master volume control. ihm interrupt high - modem (ld5). when set, mint is active high. when clear, mint is active low. ckd crystal key disable. when set, blocks the part from receiving the crystal key. note that if both ckd and pkd are set, software will be unable to re- configure the part. pkd pnp key disable. when set, blocks the part from receiving the plug-and- play key. note that if both ckd and pkd are set, software will be unable to reconfigure the part. ihs interrupt high - synthesizer. when set, sint is active high. when clear, sint is active low. ihcd interrupt high - cdrom. when set, cdint is active high. when clear, cdint is active low. ds213pp4 cs4237b 22
hw config. byte 8: global configuration bits, default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 ifm vcf1 vcf0 slad wten sps res res res must be set to zero to allow compat- ibility with future upgrades. sps dsp serial port switch. when set, switches the dsp serial port pins from the second joystick to the xd4-xd1 pins. then, when spe in i16 is set, the xd4-xd1 pins convert to the dsp serial port pins. once this bit is enabled, the sd bus will not be driven when accesses occur to peripheral port devices. this func- tion is also available in c8. wten wavetable serial port enable. when set, forces xd7-xd5 pins to convert to the cs9236 single-chip wave- table music synthesizer serial port pins. once this bit is enabled, the sd bus will not be driven when ac- cesses occur to peripheral port devices. this function is also avail- able in c8. slad soundblaster alternate line disable. when clear, sound blaster (sb) synthesizer volume changes affect the line alternate (x0/x1) volume. when set, sb synthesizer volume changes do not affect x0/x1 regis- ters. vcf1,0 hardware volume control format. these bits control the format of the hardware volume control pins up, down, and mute. the volume con- trol is enabled by setting vcen in the previous hardware configuration byte. 00 - mute is a toggle switch. when mute is low, the volume is muted. 01 - mute is a momentary switch. mute toggles between mute and un-mute. pressing the up or down switch always un-mutes. 10 - mute is not used. two button volume control. pressing the up and down buttons simultaneously causes the volume to mute. pressing up or down un-mutes. 11 - up pin is not used. the mute pin functions as the up function. with this exception, this mode functions similarly to the pervious two-button mode. this mode provides backwards compatibility with the cs4236. ifm internal fm. when set, the internal fm synthesizer is enabled. when clear, fm must be provided on the external line analog inputs. hw config. byte 9: code base byte, default = 00001011 d7 d6 d5 d4 d3 d2 d1 d0 cb7 cb6 cb5 cb4 cb3 cb2 cb1 cb0 cb7-cb0 code base byte. determines the code base located in the e 2 prom. if not correct, the firmware code after the pnp resource data is not loaded. 0x0b - cs4237b 0x43 - cs4236 the next 7 bytes are reserved for future expan- sion and must be set to their default values as listed in table 2 the next byte of hardware configuration data is byte 17 in table 2. this byte determines the function of the xctl0/xa2 pin. the default of 0, forces the pin to the control function xctl0, and the external peripheral port supports only 4 i/o locations through xa0-xa1. if this byte is set to 08h, the pin switches to the xa2 function and the peripheral port supports 8 i/o locations through xa2-xa0. the next byte, listed as byte 18, is reserved for future expansion and must be set to 0x48. ds213pp4 cs4237b 23
bytes 19 through 21 map the interrupt number to the actual interrupt pins a - f. as shown in the table, the byte 20 default is 0xb9; therefore, irqc, which is the lower nibble, maps to the isa interrupt 9. likewise irqd, which is the upper nibble, maps to the isa interrupt 11 (0bh). bytes 22 and 23 map the dma channel number to the actual dma pins a-c. as shown in the table, the byte 22 default is 0x10; therefore, drqa/ dacka is the lower nibble which maps to the isa dma channel 0. likewise drqb/ dackb is the upper nibble which maps to the isa dma channel 1. hostload procedure this procedure is provided for backwards com- patibility with the cs4236. since the e 2 prom allows all resource and firmware patch data to be loaded at power-up, this procedure is typically not used. to download pnp resource data from the host to the parts internal ram, use the fol- lowing sequence: 1. configure control i/o base address, ctrlbase, by one of two methods: regular pnp cycle or crystal key method. a. the host can use the regular pnp cycle to program the ctrlbase, and then place the chip in the wait_for_key_state b. if the crystal key method is used: first, send the 32-byte crystal key to i/o address 0279h. (the crystal key only supports one crystal part per system.) second, configure logical device 2 base address, ctrlbase, by writing to i/o 0279h (15h, 02h, 47h, xxh, xxh, 33h, 01h, 79h). note: the two xxh represent the base_ad- dress_high and base_address_low respectively. the default is: 01h, 20h. 2. write 57h (jump to rom) command to ctrlbase+5. 3. download the pnp resource data. a. send download command by writing aah to ctrlbase+5. b. send starting download address (4000h) by writing low byte (00h) first, and then high byte (40h) to ctrlbase+5. c. send the hardware configuration and re- source data in successive bytes to ctrlbase+5. this includes the hardware configuration and the pnp resource data. the pnp resource format is described in the pnp data section. the resource header should not contain the first four bytes which are only used for e 2 prom loads. 4. end download by writing 00h to ctrlbase+6. 5. if any of the hardware configuration data (first 19 bytes) has changed, 5ah must be written to ctrlbase+5 to force the part to internally update this information. the new pnp data is loaded and the part is ready for the next pnp cycle. external e 2 prom the plug and play specification defines 32 bits of the 72-bit serial identifier as being a user de- fined serial number. the e 2 prom is used to change the user section of the identifier, store default resource data for pnp, hardware con- figuration data specific to the crystal part, and firmware patches to upgrade the core processor functionality. ds213pp4 cs4237b 24
the e 2 prom interface uses an industry standard 2-wire interface consisting of a bi-directional data line and a clock line driven from the part. after power-on the part looks for the existence of an e 2 prom device and loads the user de- fined data. the existence is determined by the first two bytes read (0x55 followed by 0xbb). if the first two bytes are correct, the part reads the next two bytes to determine the length of data in the e 2 prom. the length bytes indicate the number of bytes left to be read (not including the two validation bytes or two length bytes). as shown in figure 3, the e 2 prom is read using a start bit followed by a dummy write, to initialize the address to zero. then another start bit and device address, followed by all the data. since the part uses the sequential read properties of the e 2 prom, only one e 2 prom, is supported (ganged e 2 proms are not supported). some e 2 proms that are compatible with this interface are: atmel at24cxx series microchip 24lcxxb series national nm24cxxl series ramtron fm24cxx series sgs thompson st24cxx series xicor x24cxx series where the xx is replaced by 02, 04, 08, or 16 based on the size of the e 2 prom desired. the size of 16 (2k bytes) is preferred since it allows the maximum flexibility for upgrading firmware patches. other e 2 proms compatible with fig- ure 3 and the timing parameters listed in the front of the data sheet may also be used. the maximum hardware configuration and pnp resource ram data supported is 384 bytes, and a four byte header; therefore, the maximum amount of data storage, without firmware patches, in e 2 prom would be 388 bytes. the maximum size e 2 prom supported is 2k bytes. this allows the inclusion of firmware patches af- ter the pnp resource data. if an external e 2 prom exists, it is accessed by the serial interface and is connected to the xd0 and xa0 pins. the two-wire interface is control- led by three bits in the control logical device, hardware control register (ctrlbase+1). the serial data can be written to or read from the e 2 prom by sequentially writing or reading that register. the three register bits, d0, d1, d2 are labeled clk, dout, and din/een respectively. the din/een bit, when written to a one, en- ables the e 2 prom serial interface. when the din/een bit is written to a zero, the serial inter- face is disabled. the din/een bit is also the data in (din) signal to read back data from the e 2 prom. the xd0 pin is a bi-directional open- drain data line supporting din and dout; therefore, to read the correct data, the dout bit must be set to a one prior to performing a read of the register. otherwise, the data read back from din/een will be all zeros. the e 2 prom data can then be read from the din/een bit. the clk bit timing is controlled by the host software. this is the serial clock for the e 2 prom. the dout bit is used to write/pro- gram the data out to the e 2 prom. an external pull-up resistor is required on xd0 because it is an open-drain output. use the guidelines in the s 10100000 a 00000000 a s 10100001 a data data p 1 a start part address start acknowledge no acknowledge stop acknowledge data eeprom write read bank address part address crystal ic figure 3. eeprom format ds213pp4 cs4237b 25
specific e 2 prom data sheet to select the value of the pull-up resistor (a typical value would be 3.3k w ). programming the e 2 prom: 1. configure control i/o base address by one of two methods: regular pnp cycle or crystal key method. a. the host can use the regular pnp cycle to program the logical device 2 i/o base ad- dress, and then place the chip in the wait_for_key_state b. if the crystal key method is used: first, write to i/o 0279h, send the 32- byte crystal key. (the crystal key only supports one crystal part per system.) second, configure the control i/o base address by writing 15h, 02h, 47h, 01h, 20h, 33h, 01h, 79h to 0279h. 2. refer to the specific data sheet for the e 2 prom you are using for timing require- ments and data format. also, refer to the loading resource data section of this data sheet for the e 2 prom resource data format. 3. send the e 2 prom data in successive bits to ctrlbase+1 (hardware control register) while following the e 2 prom data sheet for- mat. the e 2 prom now contains the pnp resource data. for this new data to take effect, the part must be reset, causing the part to read the e 2 prom during initialization. crystal can pro- vide a utility, resource.exe, to program e 2 proms through the control logical device in- terface. windows sound system codec the wss codec software interface consists of 4 i/o locations starting at the plug and play ad- dress wssbase, and supports 12-bit address decoding. if the upper address bits, sa12-sa15 are used, they must be 0 to decode a valid ad- dress. the wss codec also requires one interrupt and one or preferably two dma chan- nels, one for playback and one for capture. since the wss codec and sound blaster device are mutually exclusive, the two devices share the same interrupt and dma playback channel. the wss codec/mixer is register compatible with the microsoft windows sound system. functions include stereo analog-to-digital and digital-to-analog converters (adcs and dacs), analog mixing, anti-aliasing and reconstruction filters, line and microphone level inputs, optional a-law/ m -law coding, simultaneous capture and playback (at independent sample frequencies) and a parallel bus interface. five analog inputs are provided and four can be mixed to the adc mixer. all five can be mixed with the output of the dac with full volume control. several data modes are supported including 8- and 16-bit lin- ear as well as 8-bit companded, 4-bit adpcm compressed, and 16-bit big endian. enhanced functions (modes) the initial state is labeled mode 1 and forces the part to appear as a cs4248. the more popu- lar second mode, mode 2, forces the part to appear as a cs4231 super set and is compatible with the cs4232. to switch from mode 1 to mode 2, the cms1,0 bits, in the mode and id register (i12), should be set to 10 respec- tively. when mode 2 is selected, the bit ia4 in the index address register (r0) will be decoded as a valid index pointer providing 16 additional registers and increased functionality over the cs4248. to reverse the procedure, set the cms1,0 bits to 00 and the part will resume operation in ds213pp4 cs4237b 26
mode 1. except for the capture data format (i28), capture base count (i30/31), and alter- nate feature status (i24) registers, all other mode 2 functions retain their values when re- turning to mode 1. the wss codec is backwards compatible with the cs4236, cs4232, cs4231 and cs4248. the additional mode 2 functions are: full-du- plex support, a programmable timer, mono in and mono out support. mode 3 is selected by setting cms1,0 to 11. mode 3 allows access to new bits in the indi- rect registers i0-i31, and allows access to a third set of "extended registers" which are designated x0-x17+x25. the extended registers are ac- cessed through i23. the additional mode 3 functions are: 1. a full symmetrical mixer. this changes the in- put multiplexer to a input mixer. 2. independent sample frequency control on the adcs and dacs. 3. programmable gain and attenuation on the microphone inputs. 4. independent control over the volume of inter- nal fm synthesis and external wavetable. 5. volume control on the dsp serial port input data. 6. stereo volume on the monitor feedback path. fifos the wss codec contains 16-sample fifos in both the playback and capture digital audio data paths. the fifos are transparent and have no programming associated with them. when playback is enabled, the playback fifo continually requests data until the fifo is full, and then makes requests as positions inside the fifo are emptied, thereby keeping the playback fifo as full as possible. thus when the system cannot respond within a sample period, the fifo starts to empty, avoiding a momentary loss of audio data. if the fifo runs out of data, the last valid sample can be continuously output to the dacs (if dacz in i16 is set) which will elimi- nate pops from occurring. when capture is enabled, the capture fifo tries to continually stay empty by making requests every sample period. thus when the system can- not respond within a sample period, the capture fifo starts filling, thereby avoiding a loss of data in the audio data stream. wss codec pio register interface four i/o mapped locations are available for ac- cessing the codec functions and mixer. the control registers allow access to status, audio data, and all indirect registers via the index reg- isters. the ior and iow signals are used to define the read and write cycles respectively. a pio access to the codec begins when the host puts an address on to the isa bus which matches wssbase and drives aen low. wssbase is pro- grammed during a plug and play configuration sequence. once a valid base address has been decoded then the assertion of ior will cause the wss codec to drive data on the isa data bus lines. write cycles require the host to assert data on the isa data bus lines and strobe the iow signal. the wss codec will latch data into the pio register on the rising edge of the iow strobe. the audio data interface typically uses dma re- quest/grant pins to transfer the digital audio data between the wss codec and the bus. the wss codec is responsible for asserting a request sig- nal whenever the codecs internal buffers need updating. the bus responds with an acknowledge signal and strobes data to and from the codec, 8 bits at a time. the wss codec keeps the request ds213pp4 cs4237b 27
pin active until the appropriate number of 8-bit cycles have occurred to transfer one audio sam- ple. note that different audio data types will require a different number of 8-bit transfers. dma interface the second type of parallel bus cycle from the wss codec is a dma transfer. dma cycles are distinguished from pio register cycles by the as- sertion of a drq followed by an acknowledgment by the host by the assertion of dack (with aen high). while the acknow- ledgment is received from the host, the wss codec assumes that any cycles occurring are dma cycles and ignores the addresses on the address lines. the wss codec may assert the dma request signal at any time. once asserted, the dma re- quest will remain asserted until a complete dma cycle occurs to the part. dma transfers may be terminated by resetting the pen and/or cen bits in the interface configuration register (i9), de- pending on the dma that is in progress (playback, capture, or both). termination of dma transfers may only happen between sample transfers on the bus. if drq goes active while resetting pen and/or cen, the request must be acknowledged with dack and a final sample transfer completed. dma channel mapping mapping of the wss codecs drq and dack onto the isa bus is accomplished by the plug and play configuration registers. if the plug and play resource data specifies only one dma channel for the codec (or the codec is placed in sdc mode) then both the playback and capture dma requests should be routed to the same drq/ dack pair (dma channel select 0). if the plug and play resource data specifies two dma channels for the codec, then the playback dma request will be routed to the dma pair specified by the dma channel select 0 resource data, and the capture dma requests will be routed to the dma pair specified by the dma channel select 1 resource data. dual dma channel mode the wss codec supports a single and a dual dma channel mode. in dual dma channel mode, playback and capture dma requests and acknowledges occur on independent dma chan- nels. in dual dma mode, sdc should be set to 0. the playback- and capture-enables (pen, cen, i9) can be changed without a mode change enable (mce, r0). this allows for proper full duplex control where applications are independently using playback and capture. single dma channel (sdc) mode when two dma channels are not available, the sdc mode forces all dma transfers (capture or playback) to occur on a single dma channel (playback channel). the trade-off is that the wss codec will no longer be able to perform simultaneous dma capture and playback. to enable the sdc mode, set the sdc bit in the interface configuration register (i9). with the sdc bit asserted, the internal workings of the wss codec remain exactly the same as dual mode, except for the manner in which dma re- quest and acknowledges are handled. the playback of audio data will occur on the playback channel exactly as dual channel opera- tion; however, the capture audio channel is now diverted to the playback channel. alternatively stated, the capture dma request occurs on dma channel select 0 for the wss codec. (in modes 2 and 3, the capture data format is al- ways set in register i28.) if both playback and capture are enabled, the default will be playback. sdc does not have any affect when using pio accesses. ds213pp4 cs4237b 28
sound system codec register interface the windows sound system codec is mapped via four locations. the i/o base address, wssbase, is determined by the plug and play configuration. the wssbase supports four direct registers, shown in table 3. the first two direct registers are used to access 32 indirect registers shown in table 4. the index address register (wssbase+0) points to the indirect register that is accessed through the indexed data register (wssbase+1). this section describes all the direct and indirect registers for the wss codec. table 5 details a summary of each bit in each register with ta- bles 6 through 15 illustrating the majority of decoding needed when programming the wss logical device, and are included for reference. when enabled, the wss codec default state is defined as mode 1. mode 1 is backwards compatible with the cs4248 and only allows ac- cess to the first 16 indirect registers. putting the part in mode 2 or mode 3, using cms1,0 bits in the mode and id register (i12), allows ac- cess to indirect registers 16 through 31. putting the part in mode 3 also allows access to the extended registers through i23 and other ex- tended features in the indirect registers. direct mapped registers the first two wss codec registers provide indi- rect accessing to more codec registers via an index register. the other two registers provide status information and allow audio data to be transferred to and from the wss codec without using dma cycles or indexing. note that register defaults are listed in binary form with reserved bits marked with x to indi- cate unknown. to maintain compatibility with future parts, these reserved bits must be written as 0, and must be masked off when the register is read. the current value read for reserved bits is not guaranteed on future revisions. direct registers: (r0-r3) address reg. register name wssbase+0 r0 index address register wssbase+1 r1 indexed data register wssbase+2 r2 status register wssbase+3 r3 pio data register table 3. wss codec direct register index register name i0 left adc input control i1 right adc input control i2 left aux #1 volume i3 right aux #1volume i4 left aux #2 volume i5 right aux #2 volume i6 left dac (pc wave) volume i7 right dac (pc wave) volume i8 fs & playback data format i9 interface configuration i10 pin control i11 error status and initialization i12 mode and id i13 monitor loopback volume i14 playback upper base count i15 playback lower base count i16 alternate feature enable i i17 alternate feature enable ii i18 left line (synthesizer) volume i19 right line (synthesizer) volume i20 timer low byte i21 timer high byte i22 alternate sample frequency i23 extended register access (x regs) i24 alternate feature status i25 compatibility id i26 mono input & output control i27 reserved i28 capture data format i29 reserved i30 capture upper base count i31 capture lower base count table 4. wss codec indirect registers ds213pp4 cs4237b 29
indirect registers: (i0-i31) ia4-ia0 d7d6d5d4d3d2d1d0 0 lss1 lss0 lmge - lag3 lag2 lag1 lag0 1 rss1 rss0 rmge - rag3 rag2 rag1 rag0 2 lx1om lx1im lx1bm lx1g4 lx1g3 lx1g2 lx1g1 lx1g0 3 rx1om rx1im rx1bm rx1g4 rx1g3 rx1g2 rx1g1 rx1g0 4 lx2om lx2im - lx2g4 lx2g3 lx2g2 lx2g1 lx2g0 5 rx2om rx2im - rx2g4 rx2g3 rx2g2 rx2g1 rx2g0 6 ldom lpm ldg6 res ldg5 lpa5 ldg4 lpa4 ldg3 lpa3 ldg2 lpa2 ldg1 lpa1 ldg0 lpa0 7 rdom rpm rdg6 res rdg5 rpa5 rdg4 rpa4 rdg3 rpa3 rdg2 rpa2 rdg1 rpa1 rdg0 rpa0 8 fmt1 fmt0 c/ ls/ m cfs2 cfs1 cfs0 c2sl 9 cpio ppio - cal1 cal0 sdc cen pen 10 xctl1 xctl0 osm1 osm0 den dtm ien - 11 cor pur aci drs orr1 orr0 orl1 orl0 12 1 cms1 cms0 - id3 id2 id1 id0 13 lba5 lba4 lba3 lba2 lba1 lba0 - lbe 14 pub7 pub6 pub5 pub4 pub3 pub2 pub1 pub0 15 plb7 plb6 plb5 plb4 plb3 plb2 plb1 plb0 16 olb te cmce pmce sf1 sf0 spe dacz 17 test test test test apar - xtale hpf 18 llom lr7 llim lr6 llbm lr5 llg4 lr4 llg3 lr3 llg2 lr2 llg1 lr1 llg0 lr0 19 rlom rr7 rlim rr6 rlbm rr5 rlg4 rr4 rlg3 rr3 rlg2 rr2 rlg1 rr1 rlg0 rr0 20 tl7 tl6 tl5 tl4 tl3 tl2 tl1 tl0 21 tu7 tu6 tu5 tu4 tu3 tu2 tu1 tu0 22 sre div5 div4 div3 div2 div1 div0 cs2 23 xa3 xa2 xa1 xa0 xrae xa4 - acf 24 -ticipicucopopu 25 00000011 26 mim mom mby - mia3 mia2 mia1 mia0 27 -------- 28 fmt1 fmt0 c/ ls/ m- - - - 29 -------- 30 cub7 cub6 cub5 cub4 cub3 cub2 cub1 cub0 31 clb7 clb6 clb5 clb4 clb3 clb2 clb1 clb0 table 5. wss codec direct & indirect register bits direct registers: wssbase (r0-r3) address d7 d6 d5 d4 d3 d2 d1 d0 wssbase+0 r0 init mce trd ia4 ia3 ia2 ia1 ia0 wssbase+1 r1 id7 id6 id5 id4 id3 id2 id1 id0 wssbase+2 r2 cu/ lcl/ r crdy ser pu/ lpl/ r prdy int wssbase+3 r3 cd7/pd7 cd6/pd6 cd5/pd5 cd4/pd4 cd3/pd3 cd2/pd2 cd1/pd1 cd0/pd0 ds213pp4 cs4237b 30
bit5 bit4 bit3 bit2 bit1 bit0 wg5-0 (x16,17) lba5-0, pa5-0, spa5-0, fma5-0 0 0 0 0 0 0 0 12.0 db 0.0 db 1 0 0 0 0 0 1 10.5 db -1.5 db 2000010 9.0 db -3.0 db 3000011 7.5 db -4.5 db ....... - . 8 0 0 1 0 0 0 0 db -12.0 db ....... - . ....... - . 60 1 1 1 1 0 0 -78.0 db -90.0 db 61 1 1 1 1 0 1 -79.5 db -91.5 db 62 1 1 1 1 1 0 -81.0 db -93.0 db 63 1 1 1 1 1 1 -82.5 db -94.5 db table 6. wavetable, loopback, pc wave, dsp serial, & fm bit3 bit2 bit1 bit0 input gain (i0,i1) mono in (i26) 0 0 0 0 0 0.0 db 0.0 db 1 0 0 0 1 1.5 db -3.0 db 2 0 0 1 0 3.0 db -6.0 db 3 0 0 1 1 4.5 db -9.0 db ..... - . ..... - . ..... - . 12 1 1 0 0 18.0 db -36.0 db 13 1 1 0 1 19.5 db -39.0 db 14 1 1 1 0 21.0 db -42.0 db 15 1 1 1 1 22.5 db -45.0 db table 7. input adc gain and mono in levels lis1 lis0 level ris1 ris0 00 0 db 01 -6 db 10 -12 db 11 -18 db table 8. input mixer attenuation cfs 21 0 c2sl = 0 c2sl=1 0 0 0 8.0 khz 5.51 khz 0 0 1 16.0 khz 11.025 khz 0 1 0 27.42 khz 18.9 khz 0 1 1 32.0 khz 22.05 khz 1 0 0 n/a 37.8 khz 1 0 1 n/a 44.1 khz 1 1 0 48.0 khz 33.075 khz 1 1 1 9.6 khz 6.62 khz table 9. sample frequencies g4 g3 g2 g1 g0 level 0 0 0 0 0 0 12.0 db 1 0 0 0 0 1 10.5 db 2 0 0 0 1 0 9.0 db 3 0 0 0 1 1 7.5 db 4 0 0 1 0 0 6.0 db 5 0 0 1 0 1 4.5 db 6 0 0 1 1 0 3.0 db 7 0 0 1 1 1 1.5 db 8 0 1 0 0 0 0.0 db 901001-1.5 db 1001010-3.0 db 1101011-4.5 db 1201100-6.0 db ...... . ...... . ...... . 24 1 1 0 0 0 -24.0 db 25 1 1 0 0 1 -25.5 db 26 1 1 0 1 0 -27.0 db 27 1 1 0 1 1 -28.5 db 28 1 1 1 0 0 -30.0 db 29 1 1 1 0 1 -31.5 db 30 1 1 1 1 0 -33.0 db 31 1 1 1 1 1 -34.5 db table 10. aux1, aux2, line fmt1 fmt0 c/ l data format 000 linear, 8-bit unsigned 001 m -law, 8-bit companded 010 linear, 16-bit two?s complement, little endian 011 a-law, 8-bit companded 101 adpcm, 4-bit, ima compatible 110 linear, 16-bit two?s complement, big endian table 11. wss codec data format ds213pp4 cs4237b 31
decimal value hex value digital atten. analog atten. level 64 40 0 db 12.0 db 12.0 db 65 41 0 db 10.5 db 10.5 db 66 42 0 db 9.0 db 9.0 db 67 43 0 db 7.5 db 7.5 db 68 44 0 db 6.0 db 6.0 db 69 45 0 db 4.5 db 4.5 db 70 46 0 db 3.0 db 3.0 db 71 47 0 db 1.5 db 1.5 db 72 48 res res res ----- 127 7f res res res 0 0 0 db 0.0 db 0.0 db 1 1 0 db -1.5 db -1.5 db 2 2 0 db -3.0 db -3.0 db 3 3 0 db -4.5 db -4.5 db 4 4 0 db -6.0 db -6.0 db 5 5 0 db -7.5 db -7.5 db 6 6 0 db -9.0 db -9.0 db ----- 23 17 0 db -34.5 db -34.5 db 24 18 -6 db -30.0 db -36.0 db 25 19 -6 db -31.5 db -37.5 db 26 1a -6 db -33.0 db -39.0 db 27 1b -6 db -34.5 db -40.5 db 28 1c -12 db -30.0 db -42.0 db 29 1d -12 db -31.5 db -43.5 db 30 1e -12 db -33.0 db -45.0 db 31 1f -12 db -34.5 db -46.5 db 32 20 -18db -30.0 db -48.0 db ----- 62 3e -60 db -33.0 db -93.0 db 63 3f -60 db -34.5 db -94.5 db table 12. master digital gain mg4 mg3 mg2 mg1 mg0 level 0 0 0 0 0 0 22.5 db 1 0 0 0 0 1 21.0 db 2 0 0 0 1 0 19.5 db 3 0 0 0 1 1 18.0 db - ----- - 11010116.0 db 12011004.5 db 13011013.0 db 14011101.5 db 15011110 db - ----- - 28 1 1 1 0 0 -19.5 db 29 1 1 1 0 1 -21.0 db 30 1 1 1 1 0 -22.5 db 31 1 1 1 1 1 -24.0 db table 13. microphone gain decimal value sample rate divider 0 50.40 khz 16 x 21 1 48.00 khz 353 2 32.00 khz 529 3 27.42 khz 617 4 16.00 khz 1058 5 9.600 khz 1764 68.000 khz2117 7 6.620 khz 2558 8 50.40 khz 16 x 21 -- - 21 50.40 khz 16 x 21 22 48.10 khz 16 x 22 23 46.01 khz 16 x 23 24 44.10 khz 16 x 24 25 42.36 khz 16 x 25 26 40.70khz 16 x 26 -- - 189 5600 khz 16 x 189 190 5570.5 khz 16 x 190 191 5541.4 khz 16 x 191 192 5512.5 khz 16 x 192 -- - 255 5512.5 khz 16 x 192 table 14. a/d sample rate (srad7-srad0) decimal value sample rate divider 0 50.40 khz 16 x 21 1 48.00 khz 353 2 32.00 khz 529 3 27.42 khz 617 4 16.00 khz 1058 5 9.600 khz 1764 6 8.000 khz 2117 7 6.620 khz 2558 8 50.40 khz 16 x 21 -- - 21 50.40 khz 16 x 21 22 48.10 khz 16 x 22 23 46.01 khz 16 x 23 24 44.10 khz 16 x 24 25 42.36 khz 16 x 25 26 40.70 khz 16 x 26 27 39.20 khz 16 x 27 28 37.80 khz 16 x 28 -- - 255 4.150 khz 16 x 255 table 15. d/a sample rate (srda7-srda0) ds213pp4 cs4237b 32
index address register (wssbase+0, r0) d7 d6 d5 d4 d3 d2 d1 d0 init mce trd ia4 ia3 ia2 ia1 ia0 ia3-ia0 index address: these bits define the address of the indirect register ac- cessed by the indexed data register (r1). these bits are read/write. ia4 allows access to indirect registers 16 - 31. in mode 1, this bit is re- served and must be written as zero. trd transfer request disable: this bit, when set, causes dma transfers to cease when the int bit of the status register (r2) is set. independent for playback and capture interrupts. 0 - transfers enabled (playback and capture drqs occur uninhibited) 1 - transfers disabled (playback and capture drq only occur if int bit is 0) mce mode change enable: this bit must be set whenever the current mode of the wss codec is changed. the data format (i8, i28) and interface configuration (i9) registers cannot be changed unless this bit is set. the exceptions are cen and pen which can be changed "on-the-fly". the dac output is muted when mce is set. init wss codec initialization: this bit is read as 1 when the codec is in a state in which it cannot respond to parallel interface cycles. this bit is read-only. immediately after reset (and once the wss codec has left the init state), the state of this register is: 010x0000 (binary - where x indi- cates unknown). during initialization and software power down (pm1,0 = 01), this register cannot be written and always reads 10000000 (80h) indexed data register (wssbase+1, r1) d7 d6 d5 d4 d3 d2 d1 d0 id7 id6 id5 id4 id3 id2 id1 id0 id7-id0 indexed data register: these bits are the indirect register referenced by the indexed address register (r0). during initialization and software power down of the wss codec, this register can not be written and is always read 10000000 (80h) status register (wssbase+2, r2, read only) d7 d6 d5 d4 d3 d2 d1 d0 cu/ lcl/ r crdy ser pu/ lpl/ r prdy int int interrupt status: this indicates the status of the internal interrupt logic of the wss codec. this bit is cleared by any write of any value to this register. the ien bit of the pin control register (i10) determines whether the state of this bit is re- flected on the irq pin assigned to the wss codec. read states 0 - interrupt inactive 1 - interrupt active prdy playback data ready. the playback data register (r3) is ready for more data. this bit would be used when di- rect programmed i/o data transfers are desired. 0 - data still valid. do not overwrite. 1 - data stale. ready for next host data write value. ds213pp4 cs4237b 33
pl/ r playback left/right sample: this bit indicates whether data needed is for the left channel or right channel in all data formats except adpcm. in adpcm it indicates whether the first two or last two bytes of a 4-byte set (8 adpcm samples) are needed. 0 - right or 3/4 adpcm byte needed 1 - left, mono, or 1/2 adpcm byte needed pu/ l playback upper/lower byte: this bit indicates whether the playback data needed is for the upper or lower byte of the channel. in adpcm it in- dicates, along with pl/ r, which one of the four adpcm bytes is needed. 0 - lower or 1/3 adpcm byte needed 1 - upper, any 8-bit format, or 2/4 adpcm byte needed. ser sample error: this bit indicates that a sample was not serviced in time and an error has occurred. the bit indi- cates an overrun for capture and underrun for playback. if both the capture and playback are enabled, the source which set this bit can not be determined. however, the alter- nate feature status register (i24) can indicate the exact source of the error. crdy capture data ready. the capture data register (r3) contains data ready for reading by the host. this bit would be used for direct pro- grammed i/o data transfers. 0 - data is stale. do not reread the information. 1 - data is fresh. ready for next host data read. cl/ r capture left/right sample: this bit indicates whether the capture data waiting is for the left channel or right channel in all audio data for- mats except adpcm. in adpcm it indicates whether the first two or last two bytes of a 4-byte set (8 adpcm samples) are waiting. 0 - right or 3/4 adpcm byte available 1 - left, mono, or 1/2 adpcm byte available cu/ l capture upper/lower byte: this bit indicates whether the capture data ready is for the upper or lower byte of the channel. in adpcm it indi- cates, along with cl/ r, which one of four adpcm bytes is available. 0 - lower or 1/3 adpcm byte available 1 - upper, any 8-bit format, or 2/4 adpcm byte available note on prdy/crdy: these two bits are de- signed to be read as one when action is required by the host. for example, when prdy is set to one, the device is ready for more data; or when the crdy is set to one, data is available to the host. the definition of the crdy and prdy bits are therefore consistent in this regard. i/o data registers the pio data register is two registers mapped to the same address. writes to this register sends data to the playback data register. reads from this register will receive data from the capture data register. during initialization and software power down of the wss codec, this register cannot be written and is always read 10000000 (80h) ds213pp4 cs4237b 34
capture i/o data register (wssbase+3, r3, read only) d7 d6 d5 d4 d3 d2 d1 d0 cd7 cd6 cd5 cd4 cd3 cd2 cd1 cd0 cd7-cd0 capture data port. this is the control register where capture data is read during programmed i/o data trans- fers. the reading of this register will increment the state machine so that the following read will be from the next appropriate byte in the sample. the exact byte which is next to be read can be determined by reading the status register (r2). once all relevant bytes have been read, the state machine will point to the last byte of the sample until a new sample is received from the adcs. once the status register (r2) is read and a new sample is received from the fifo, the state ma- chine and status register (r2) will point to the first byte of the new sample. during initialization and software power down of the wss codec, this register can not be written and is always read 10000000 (80h) playback i/o data register wssbase+3, r3, write only) d7 d6 d5 d4 d3 d2 d1 d0 pd7pd6pd5pd4pd3pd2pd1pd0 pd7-pd0 playback data port. this is the control register where playback data is written during programmed io data transfers. writing data to this register will increment the playback byte tracking state machine so that the following write will be to the correct byte of the sample. once all bytes of a sample have been written, subsequent byte writes to this port are ignored. the state machine is reset after the status register (r2) is read, and the current sam- ple is sent to the dacs via the fifos. indirect mapped registers these registers are accessed by placing the ap- propriate index in the index address register (r0) and then accessing the indexed data regis- ter (r1). a detailed description of each indirect register is given below. all reserved bits should be written zero and may be 0 or 1 when read. note that indirect registers 16-31 are not avail- able when in mode 1 (cms1,0 in mode and id register i12 are both zero). left adc input control (i0) default = 000x0000 d7 d6 d5 d4 d3 d2 d1 d0 lss1 lss0 lmge res lag3 lag2 lag1 lag0 lag3-lag0 left adc gain. the least significant bit represents +1.5 db, with 0000 = 0 db. see table 7. res reserved. must write 0. could read as 0 or 1. lmge this bit has no function in mode 3. in modes 1 & 2 it controls the 20 db gain boost for the left mic in- put to the adc. lss1-lss0 left output loopback. in mode 3, setting these bits to 11 enables the left output loopback into the input mixer. bit combinations of 01, 10, and 00 disable the loopback. in modes 1 & 2, the input mixer is used as a multiplexer where these bits select the left adc input source. 00 - lline 01 - laux1 10 - lmic 11 - left output mixer loopback ds213pp4 cs4237b 35
right adc input control (i1) default = 000x0000 d7 d6 d5 d4 d3 d2 d1 d0 rss1 rss0 rmge res rag3 rag2 rag1 rag0 rag3-rag0 right adc gain. the least significant bit represents +1.5 db, with 0000 = 0 db. see table 7. res reserved. must write 0. could read as 0 or 1. rmge this bit has no function in mode 3. in modes 1 & 2 it controls the 20 db gain boost for the right mic in- put to the adcs. rss1-rss0 right output loopback. in mode 3 setting these bits to 11 enables the right output loopback into the input mixer. other bit combinations dis- able the loopback. in modes 1 & 2, the input mixer is used as a mux. where these bits se- lect the right adc input source. 00 - rline 01 - raux1 10 - rmic 11 - right output mixer loopback left auxiliary #1 volume (i2) default = 11101000 d7 d6 d5 d4 d3 d2 d1 d0 lx1om lx1im lx1bm lx1g4 lx1g3 lx1g2 lx1g1 lx1g0 lx1g4-lx1g0 left auxiliary #1, laux1, mix gain. the least significant bit represents 1.5 db, with 01000 = 0 db. see table 10. lx1bm left auxiliary #1 bypass mute. in mode 3, when set, the left auxiliary #1 input, laux1, (bypassing the gain) to the input mixer, is muted. in modes 1 & 2, this bit is not avail- able and is internally controlled by lss1,0 in i0. lx1im left auxiliary #1 mute. in mode 3, when set, the left auxiliary #1 input, laux1, to the input mixer through the gain stage, is muted. in modes 1 & 2, this bit is not avail- able and internally forced on (muted). lx1om left auxiliary #1 mute. when set to 1, the left auxiliary #1 input, laux1, to the output mixer through the gain stage, is muted. right auxiliary #1 volume (i3) default = 11101000 d7 d6 d5 d4 d3 d2 d1 d0 rx1om rx1im rx1bm rx1g4 rx1g3 rx1g2 rx1g1 rx1g0 rx1g4-rx1g0 right auxiliary #1, raux1, mix gain. the least significant bit represents 1.5 db, with 01000 = 0 db. see table 10. rx1bm right auxiliary #1 bypass mute. in mode 3, when set, the right auxil- iary #1 input, raux1, (bypassing the gain) to the input mixer is muted. in modes 1 & 2, this bit is not avail- able and is internally controlled by rss1,0 in i1. rx1im right auxiliary #1 mute. when set to 1, the right auxiliary #1 input, raux1, to the input mixer through the gain stage, is muted. in modes 1 & 2, this bit is not avail- able and internally forced on (muted). rx1om right auxiliary #1 mute. when set to 1, the right auxiliary #1 input, raux1, to the output mixer through the gain stage, is muted. lx1g4-g0 laux1 (line in) lx1im lx1om lx1bm to output mixer to input mixer +12 to -34.5 db rx1g4-g0 raux1 (line in) rx1im rx1om rx1bm to output mixer to input mixer +12 to -34.5 db ds213pp4 cs4237b 36
left auxiliary #2 volume (i4) default = 11x01000 d7 d6 d5 d4 d3 d2 d1 d0 lx2om lx2im res lx2g4 lx2g3 lx2g2 lx2g1 lx2g0 lx2g4-lx2g0 left auxiliary #2, laux2, mix gain. the least significant bit represents 1.5 db, with 01000 = 0 db. see table 10. res reserved. must write 0. lx2im left auxiliary #2 mute. in mode 3, when set to 1, the left auxiliary #2 in- put, laux2, to the input mixer through the gain stage, is muted. in modes 1 & 2, this bit is not avail- able and internally forced on (muted). lx2om left auxiliary #2 mute. when set to 1, the left auxiliary #2 input, laux2, to the output mixer through the gain stage, is muted. right auxiliary #2 volume (i5) default = 11x01000 d7 d6 d5 d4 d3 d2 d1 d0 rx2om rx2im res rx2g4 rx2g3 rx2g2 rx2g1 rx2g0 rx2g4-rx2g0 right auxiliary #2, raux2, mix gain. the least significant bit represents 1.5 db, with 01000 = 0 db. see table 10. res reserved. must write 0. could read as 0 or 1. rx2im right auxiliary #2 mute. in mode 3, when set, the right auxiliary #2 in- put, raux2, to the input mixer through the gain stage, is muted. in modes 1 & 2, this bit is not avail- able and internally forced on (muted). rx2om right auxiliary #2 mute. when set to 1, the right auxiliary #2 input, raux2, to the output mixer through the gain stage, is muted. left dac (pc wave) volume (i6) default = 10000000 d7 d6 d5 d4 d3 d2 d1 d0 ldom ldg6 ldg5 ldg4 ldg3 ldg2 ldg1 ldg0 lpm res lpa5 lpa4 lpa3 lpa2 lpa1 lpa0 if both ifm (x4 or global config. byte) and wten (c8 or global config. byte) are cleared, this register is the master digital audio volume for the left channel with the following bit definitions: ldg6-ldg0 left dac master volume. the least significant bit represents 1.5 db, with 0000000 = 0 db. the total range is +12 to -94.5 db. see table 12. ldom left dac master mute. when set, the left dac to the output mixer is muted. if ifm or wten is set, this register controls the left channel volume for data coming from the isa bus only (and x14 is the left channel digital audio master volume) with the following bit descriptions. lpa5-lpa0 left pc wave attenuation. the least significant bit represents -1.5 db, with 000000 = 0 db. the total range is 0 to -94.5 db. see table 6. res reserved. must write 0. could read as 0 or 1. lpm left pc wave mute. when set, the left pcm input to the digital mixer summer will be muted. lx2g4-g0 laux2 (line in) lx2im lx2om to output mixer to input mixer +12 to -34.5 db rx2g4-g0 raux2 (line in) rx2im rx2om to output mixer to input mixer +12 to -34.5 db ds213pp4 cs4237b 37
right dac (pc wave) volume (i7) default = 10000000 d7 d6 d5 d4 d3 d2 d1 d0 rdom rdg6 rdg5 rdg4 rdg3 rdg2 rdg1 rdg0 rpm res rpa5 rpa4 rpa3 rpa2 rpa1 rpa0 if both ifm (x4 or global config. byte) and wten (c8 or global config. byte) are cleared, this register is the master digital audio volume for the right chan- nel with the following bit definitions: rdg6-rdg0 right dac master volume. the least significant bit represents 1.5 db, with 0000000 = 0 db. the total range is +12 to -94.5 db. see table 12. rdom right dac master mute. when set, the right dac to the output mixer is muted. if ifm or wten is set, this register controls the right channel volume for data coming from the isa bus only (and x15 is the right channel digital audio mas- ter volume) with the following bit descriptions. rpa5-rpa0 right pc wave attenuation. the least significant bit represents -1.5 db, with 000000 = 0 db. the total range is 0 to -94.5 db. see table 6. res reserved. must write 0. could read as 0 or 1. rpm right pc wave mute. when set, the right pcm input to the digital mixer summer will be muted. fs and playback data format (i8) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 fmt1 fmt0 c/ ls/ m cfs2 cfs1 cfs0 c2sl c2sl clock 2 source select: this bit selects the clock base used for the audio sample rates for both capture and playback. note that this bit can be disabled by setting sre in i22 or by setting ifse in x11. caution: c2sl can only be changed while mce (r0) is set. see table below. cfs2-cfs0 clock frequency divide select: these bits select the audio sample fre- quency for both capture and playback. the actual audio sample frequency depends on which clock base (c2sl) is selected. note that these bits can be disabled by setting sre in i22 or ifse in x11. caution: cfs2-cfs0 can only be changed while mce (r0) is set. divide c2sl = 0 c2sl = 1 0 - 3072 8.0 khz 5.51 khz 1 - 1536 16.0 khz 11.025 khz 2 - 896 27.42 khz 18.9 khz 3 - 768 32.0 khz 22.05 khz 4 - 448 n/a 37.8 khz 5 - 384 n/a 44.1 khz 6 - 512 48.0 khz 33.075 khz 7 - 2560 9.6 khz 6.62 khz s/ m stereo/mono select: this bit deter- mines how the audio data streams are formatted. selecting stereo will result in alternating samples repre- senting left and right audio channels. mono playback plays the same audio sample on both channels. mono capture only captures data from the left channel. in mode 1, this bit is used for both playback and capture. in modes 2 and 3, this bit is only used for playback, and the capture format is independently se- lected via i28. mce (r0) or pmce (i16) must be set to modify s/ m. see changing audio data formats section for more details. ds213pp4 cs4237b 38
0 - mono 1 - stereo c/ l, fmt1, and fmt0 bits set the audio data format as shown below. in mode 1, fmt1, which is forced low, fmt0, and c/ l are used for both playback and cap- ture. in modes 2 and 3, these bits are only used for playback, and the capture format is independently se- lected via register i28. mce (r0) or pmce (i16) must be set to modify the upper four bits of this register. see changing audio data formats section for more details. fmt1 ? d7 fmt0 d6 c/ l d5 audio data format 000 linear, 8-bit unsigned 001 m -law, 8-bit companded 010 linear, 16-bit two?s complement, little endian 011 a-law, 8-bit companded 100 reserved 101 adpcm, 4-bit, ima compatible 110 linear, 16-bit two?s complement, big endian 111 reserved ? fmt1 is not available in mode 1 (forced to 0). interface configuration (i9) default = 00x01000 d7 d6 d5 d4 d3 d2 d1 d0 cpio ppio res cal1 cal0 sdc cen pen pen playback enable. this bit enables playback. the wss codec will generate a drq and respond to dack signal when this bit is en- abled and ppio=0. if ppio=1, pen enables pio playback mode. pen may be set and reset without setting the mce bit. 0 - playback disabled (playback drq and pio inactive) 1 - playback enabled cen capture enabled. this bit enables the capture of data. the wss codec will generate a drq and respond to dack signal when cen is enabled and cpio=0. if cpio=1, cen en- ables pio capture mode. cen may be set and reset without setting the mce bit. 0 - capture disabled (capture drq and pio inactive) 1 - capture enabled sdc single dma channel: this bit will force both capture and playback dma re- quests to occur on the playback dma channel. this bit forces the wss codec to use one dma chan- nel. should both capture and playback be enabled in this mode, only the playback will occur. see the dma interface section for further ex- planation. 0 - dual dma channel mode 1 - single dma channel mode cal1,0 calibration: these bits determine which type of calibration the wss codec performs whenever the mode change enable (mce) bit, r0, changes from 1 to 0. the number of sample periods required for calibra- tion is listed in parenthesis. 0 - no calibration (0) 1 - converter calibration (321) 2 - dac calibration (120) 3 - full calibration (450) ppio playback pio enable: this bit deter- mines whether the playback data is transferred via dma or pio. 0 - dma transfers 1 - pio transfers cpio capture pio enable: this bit deter- mines whether the capture data is transferred via dma or pio. 0 - dma transfers 1 - pio transfers ds213pp4 cs4237b 39
caution: this register, except bits cen and pen, can only be written while in mode change enable (either mce or pmce). see the chang- ing sampling rate section for more details. pin control (i10) default = 0000000x d7 d6 d5 d4 d3 d2 d1 d0 xctl1 xctl0 osm1 osm0 den dtm ien res res reserved. must write 0. could read as 0 or 1. ien interrupt enable: this bit enables the interrupt pin. the interrupt pin will re- flect the value of the int bit of the status register (r2). the interrupt pin is active high. 0 - interrupt disabled 1 - interrupt enabled dtm dma timing mode. mode 2 & 3 only. when set, causes the current dma request signal to be deasserted on the rising edge of the iow or ior strobe during the next to last byte of a dma transfer. when dtm = 0 the dma request is released on the fall- ing edge of the iow or ior during the last byte of a dma transfer. den dither enable: when set, triangular pdf dither is added before truncating the adc 16-bit value to 8-bit, un- signed data. dither is only active in the 8-bit unsigned data mode. 0 - dither enabled 1 - dither disabled osm1-osm0 these bits are enabled by setting sre = 1 in i22. these bits in com- bination with div5-div0 and cs2 (i22) determine the current sample rate of the wss codec when sre = 1. note that these bits can be disabled by setting ifse in x11. 00 - 12khz < fs 24khz 01 - fs > 24khz 10 - fs 12khz 11 - reserved xctl1-xctl0 xctl control: these bits are reflected on the xctl1,0 pins of the part. note: these pins are multiplexed with other functions; therefore, they may not be available on a particular design. 0 - ttl logic low on xctl1,0 pins 1 - ttl logic high on xctl1,0 pins error status and initialization (i11, read only) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 cor pur aci drs orr1 orr0 orl1 orl0 orl1-orl0 overrange left detect: these bits determine the overrange on the left adc channel. these bits are up- dated on a sample by sample basis. 0 - less than -1.5 db 1 - between -1.5 db and 0 db 2 - between 0 db and 1.5 db overrange 3 - greater than 1.5 db overrange orr1-orr0 overrange right detect: these bits determine the overrange on the right adc channel. 0 - less than -1.5 db 1 - between -1.5 db and 0 db 2 - between 0 db and 1.5 db overrange 3 - greater than 1.5 db overrange drs drq status: this bit indicates the current status of the drqs assigned to the wss codec. 0 - capture and playback drqs are presently inactive 1 - capture or playback drqs are presently active ds213pp4 cs4237b 40
aci auto-calibrate in-progress: this bit indicates the state of calibration. 0 - calibration not in progress 1 - calibration is in progress pur playback underrun: this bit is set when playback data has not arrived from the host in time to be played. as a result, if dacz = 0, the last valid sample will be sent to the dacs. this bit is set when an error occurs and will not clear until the status register (r2) is read. cor capture overrun: this bit is set when the capture data has not been read by the host before the next sample arrives. the old sample will not be overwritten and the new sample will be ignored. this bit is set when an error condition occurs and will not clear until the status register (r2) is read. the ser bit in the status register (r2) is simply a logical or of the cor and pur bits. this enables a polling host cpu to detect an error condition while checking other status bits. mode and id (i12) default = 100x1010 d7 d6 d5 d4 d3 d2 d1 d0 1 cms1 cms0 res id3 id2 id1 id0 id3-id0 codec id: these four bits indicate the id and initial revisions of the codec. further revisions are expanded in in- direct register i25 through the cs4236 and c1 for newer chips. these bits are read only. 0001 - rev b cs4248/cs4231 1010 - all other revisions and parts. see registers x25 or c1. res reserved. must write 0. could read as 0 or 1. cms1,0 codec mode select bits: enables the extended registers and functions of the part. 00 - mode 1 01 - reserved 10 - mode 2 11 - mode 3 monitor loopback volume (i13) default = 000000x0 d7 d6 d5 d4 d3 d2 d1 d0 lba5 lba4 lba3 lba2 lba1 lba0 res lbe lbe loopback enable: when set to 1, the adc data is digitally mixed with data sent to the dacs. this bit controls the loopback enable for both chan- nels regardless of how slbe in x10 is set. 0 - loopback disabled 1 - loopback enabled res reserved. must write 0. could read as 0 or 1. lba5-lba0 loopback attenuation: these bits determine the attenuation of the loop- back from adc to dac. the least significant bit represents -1.5 db, with 000000 = 0 db. see table 6. lba5-lba0 control left and right channels when slbe in x10 is clear. when slbe = 1, these bits only control the left channel and rlba5- rlba0 in x10 control the right. playback upper base (i14) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 pub7 pub6 pub5 pub4 pub3 pub2 pub1 pub0 pub7-pub0 playback upper base: this register is the upper byte which represents the 8 most significant bits of the 16-bit playback base register. reads from this register return the same value ds213pp4 cs4237b 41
which was written. the current count registers cannot be read. when set for mode 1 or sdc, this register is used for both the play- back and capture base registers. playback lower base (i15) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 plb7 plb6 plb5 plb4 plb3 plb2 plb1 plb0 plb7-plb0 lower base bits: this register is the lower byte which represents the 8 least significant bits of the 16-bit playback base register. reads from this register return the same value which was written. when set for mode 1 or sdc, this register is used for both the playback and cap- ture base registers. alternate feature enable i (i16) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 olb te cmce pmce sf1 sf0 spe dacz dacz dac zero: this bit will force the out- put of the playback channel to ac zero when an underrun error occurs 1 - go to center scale 0 - hold previous valid sample spe dsp serial port enable. when set, audio data from the adcs is sent out sdout and audio data from sdin is sent to the dacs. mce in r0 must be set to change this bit. 1 - enable serial port 0 - disable serial port. isa bus used for audio data. sf1,sf0 serial format. selects the format of the serial port when enabled by spe. mce in r0 must be set to change these bits. 0 - 64-bit enhanced. figure 9. 1 - 64-bit. figure 10. 2 - 32-bit. figure 11. 3 - adc/dac. figure 12. pmce playback mode change enable. when set, it allows modification of the stereo/mono and audio data for- mat bits (d7-d4) for the playback channel, i8. mce in r0 must be used to change the sample fre- quency. cmce capture mode change enable. when set, it allows modification of the stereo/mono and audio data for- mat bits (d7-d4) for the capture channel, i28. mce in r0 must be used to change the sample fre- quency in i8. te timer enable: this bit, when set, will enable the timer to run and interrupt the host at the specified frequency in the timer registers. olb output level bit: provided for back- wards compatibility with the cs4236. this bit does nothing on this chip. alternate feature enable ii (i17) default = 0000x000 d7 d6 d5 d4 d3 d2 d1 d0 test test test test apar res xtale hpf hpf high pass filter: this bit enables a dc-blocking high-pass filter in the digital filter of the adc. this filter forces the adc offset to 0. 0 - disabled 1 - enabled xtale crystal enable. provided for back- wards compatibility with the cs4231a. this bit does nothing on the this part. res reserved. must write 0. could read as 0 or 1. ds213pp4 cs4237b 42
apar adpcm playback accumulator reset. while set, the playback adpcm accumulator is held at zero. used when pausing a playback stream. test factory test. these bits are used for factory testing and must remain at 0 for normal operation. left line (synthesizer) volume (i18) default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 llom llim llbm llg4 llg3 llg2 llg1 llg0 lr7 lr6 lr5 lr4 lr3 lr2 lr1 lr0 this register controls either the left line input or is remapped to control the internal fm (x6) or external cs9236 wavetable synthesizer (x16), or both. when no remapping occurs, the bit definitions are: llg4-llg0 left line volume. this register is used to control the lline analog in- put volume to the mixers. the least significant bit represents 1.5 db, with 01000 = 0 db. see table 10. llbm left line bypass mute. in mode 3, when set to 1, the analog left line input, lline, (bypassing the gain block) to the input mixer is muted. in modes 1 & 2, this bit is not avail- able and is internally controlled by lss1,0 in i0. llim left line input mute. in mode 3, when set to 1, the left line input, lline, from the volume control to the input mixer is muted. in modes 1 & 2, this bit is not avail- able and internally forced on (muted). llom left line output mute. when set to 1, the left line input, lline, from the volume control to the output mixer is muted. when ifm=1 (x4 or global config. byte) and fmrm=1 (x4), fm remapping is enabled. when wten=1 (c8 or global config. byte) and wtrmd=0 (x4), wavetable remapping is enabled. if either synthesizer remap is enabled, left line ana- log volume is controlled through x0. with remapping the bit definitions are: lr7-lr0 left remapped register. when ifm=1 and fmrm=1, writes to i18 will write the internal fm regis- ter x6. when wten=1 and wtrmd=0, writes to i18 will write the wavetable synthesis register x16. right line (synthesizer) volume (i19) default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 rlom rlim rlbm rlg4 rlg3 rlg2 rlg1 rlg0 rr7 rr6 rr5 rr4 rr3 rr2 rr1 rr0 this register controls either the right line input or is remapped to control the internal fm (x7) or external cs9236 wavetable synthesizer (x17), or both. when no remapping occurs, the bit definitions are: rlg4-rlg0 right line volume. this register is used to control the rline analog in- put volume to the mixers. the least significant bit represents 1.5 db, with 01000 = 0 db. see table 10. llg4-g0 lline (synthesis) llim llom llbm to output mixer to input mixer +12 to -34.5 db ds213pp4 cs4237b 43
rlbm right line bypass mute. in mode 3, when set to 1, the analog right line input, rline, (bypassing the gain block) to the input mixer is muted. in modes 1 & 2, this bit is not avail- able and is internally controlled by rss1,0 in i1. rlim right line input mute. in mode 3, when set to 1, the right line input, rline, from the volume control to the input mixer is muted. in modes 1 & 2, this bit is not avail- able and internally forced on (muted). rlom right line output mute. when set to 1, the right line input, rline, from the volume control to the output mixer is muted. when ifm=1 and fmrm=1, fm remapping is en- abled. when wten=1 and wtrmd=0, wavetable remapping is enabled. if either synthesizer remap is enabled, right line analog volume is controlled through x1. with remapping the bit definitions are: rr7-rr0 right remapped register. when ifm=1 and fmrm=1, writes to i19 will write the internal fm regis- ter x7. when wten=1 and wtrmd=0, writes to i19 will write the wavetable synthesis register x17. timer lower base (i20) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 tl7 tl6 tl5 tl4 tl3 tl2 tl1 tl0 tl7-tl0 lower timer bits: this is the low order byte of the 16-bit timer base register. writes to this register cause both timer base registers to be loaded into the internal timer; therefore, the upper timer register should be loaded before the lower. once the count reaches zero, an interrupt is generated, if enabled, and the timer is automatically reloaded with these base registers. timer upper base (i21) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 tu7 tu6 tu5 tu4 tu3 tu2 tu1 tu0 tu7-tu0 upper timer bits: this is the high order byte of the 16-bit timer. the time base is determined by the fre- quency base selected from either c2sl in i8 or cs2 in i22. c2sl = 0 - 24.576mhz / 245 (9.969 m s) c2sl = 1 - 16.9344mhz / 168 (9.92 m s) alternate sample frequency select (i22) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 srediv5div4div3div2div1div0 cs2 cs2 clock 2 base select. this bit selects the base clock frequency used for generating the audio sample rate. note that the part uses only one crystal to generate both clock base frequencies. this bit can be disabled by setting ifse in x11. 0 - 24.576 mhz base 1 - 16.9344 mhz base div5 - div0 clock divider. these bits select the audio sample frequency for both cap- ture and playback. these bits can be overridden by ifse in x11. fs = (2*xt)/(m*n) rlg4-g0 rline (synthesis) rlim rlom rlbm to output mixer to input mixer +12 to -34.5 db ds213pp4 cs4237b 44
xt = 24.576 mhz cs2 = 0 xt = 16.9344 mhz cs2 = 1 n = div5-div0 16 n 49 for xt = 24.576 mhz 12 n 33 for xt = 16.9344 mhz (m set by osm1,0 in i10) m = 64 for fs > 24 khz m = 128 for 12 khz < fs 24 khz m = 256 for fs 12 khz sre alternate sample rate enable. when this bit is set to a one, bits 0-3 of i8 will be ignored, and the sample fre- quency is then determined by cs2, div5-div0, and the oversampling mode bits osm1, osm0 in i10. note that this register can be overridden (disabled) by ifse in x11. extended register access (i23) default = 00000xx0 d7 d6 d5 d4 d3 d2 d1 d0 xa3 xa2 xa1 xa0 xrae xa4 res acf acf adpcm capture freeze. when set, the capture adpcm accumulator and step size are frozen. this bit must be set to zero for adaptation to continue. this bit is used when pausing a adpcm capture stream. res reserved. must write 0. could read as 0 or 1. xa4 extended register address bit 4. along with xa3-xa0, enables ac- cess to extended registers x16, x17, and x25. mode 3 only. xrae extended register access enable. setting this bit converts this register from the extended address register to the extended data register. to con- vert back to an address register, r0 must be written. mode 3 only. xa3-xa0 extended register address. along with xa4, sets the register number (x0-x17+x25) accessed when xrae is set. mode 3 only. see the wss extended register section for more details. alternate feature status (i24) default = x0000000 d7 d6 d5 d4 d3 d2 d1 d0 res ti ci pi cu co po pu pu playback underrun: when set, indicates the dac has run out of data and a sample has been missed. po playback overrun: when set, indicates that the host attempted to write data into a full fifo and the data was discarded. co capture overrun: when set, indicates that the adc had a sample to load into the fifo but the fifo was full. in this case, this bit is set and the new sample is discarded. cu capture underrun: indicates the host has read more data out of the fifo than it contained. in this condition, the bit is set and the last valid byte is read by the host. pi playback interrupt: indicates an interrupt is pending from the play- back dma count registers. ci capture interrupt: indicates an interrupt is pending from the capture dma count registers. ti timer interrupt: indicates an interrupt is pending from the timer registers ds213pp4 cs4237b 45
res reserved. must write 0. could read as 0 or 1. the pi, ci, and ti bits are reset by writing a "0" to the particular interrupt bit or by writing any value to the status register (r2). compatibility id (i25) default = 00000011 d7 d6 d5 d4 d3 d2 d1 d0 v2 v1 v0 cid4 cid3 cid2 cid1 cid0 cid4-cid0 chip identification. distinguishes between this chip and previous codec chips that support this register set. this register is fixed to indicate code compatibility with the cs4236. x25 or c1 should be used to further differentiate between parts that are compatible with the cs4236. all chips: 00011 - cs4236, cs4237b 00010 - cs4232/cs4232a 00000 - cs4231/cs4231a v2-v0 version number. as enhancements are made to the part, the version number is changed so software can distinguish between the different ver- sions. 000 - compatible with the cs4236 these bits are fixed for compatibility with the cs4236. register x25 or c1 may be used to differentiate be- tween the cs4236 and newer chips. mono input and output control (i26) default = 101x0000 d7 d6 d5 d4 d3 d2 d1 d0 mim mom mby res mia3 mia2 mia1 mia0 mia3-mia0 mono input attenuation. when mim is 0, these bits set the level of min summed into the mixer. mia0 is the least significant bit and represents 3 db attenuation, with 0000 = 0 db. see table 7. res reserved. must write 0. could read as 0 or 1. mby mono bypass. mby connects min directly to mout with an attenuation of 9 db. when mby = 1, mim should be set to 1. 0 - min not connected directly to mout. 1 - min connected directly to mout. mom mono output mute. in mode 3, mom will mute the left line out to the mono mix output, mout. the right line out mute, momr, is in x5. in mode 2, mom mutes left and right line out to mout. this mute is inde- pendent of the line output mute. 0 - no mute 1 - mute mim mono input mute. in mode 3, mim mutes the min analog input to the left output mixer channel. mimr in x4 mutes min analog input to the right output mixer channel. in mode 2, mim mutes both left and ds213pp4 cs4237b 46
right channels. the mono input pro- vides mix for the "beeper" function in most personal computers. 0 - no mute 1 - muted reserved (i27) default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 res res res res res res res res res reserved. must write 0. could read as 0 or 1. capture data format (i28) default = 0000xxxx d7 d6 d5 d4 d3 d2 d1 d0 fmt1 fmt0 c/ ls/ m res res res res res reserved. must write 0. could read as 0 or 1. s/ m stereo/mono select: this bit deter- mines how the capture audio data stream is formatted. selecting stereo will result with alternating samples representing left and right audio channels. selecting mono only cap- tures data from the left audio channel. mce (r0) or cmce (i16) must be set to modify s/ m. see changing audio data formats sec- tion for more details. 0 - mono 1 - stereo c/l, fmt1, fmt0 set the capture data format in modes 2 and 3. see table 11 or register i8 for the bit settings and data formats. the capture data for- mat can be different than the playback data format; however, the sample frequency must be the same and is set in i8. mce (r0) or cmce (i16) must be set to modify this regis- ter. see changing audio data formats section for more details. reserved (i29) default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 res res res res res res res res res reserved. must write 0. could read as 0 or 1. capture upper base (i30) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 cub7 cub6 cub5 cub4 cub3 cub2 cub1 cub0 cub7-cub0 capture upper base: this register is the upper byte which represents the 8 most significant bits of the 16-bit capture base register. reads from this this register returns the same value that was written. capture lower base (i31) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 clb7 clb6 clb5 clb4 clb3 clb2 clb1 clb0 clb7-clb0 lower base bits: this register is the lower byte which represents the 8 least significant bits of the 16-bit capture base register. reads from this register returns the same value which was written. ds213pp4 cs4237b 47
wss extended registers the windows sound system codec contains three sets of registers: r0-r3, i0-i31, and x0- x25. r0-r3 are directly mapped to the isa bus through wssbase+0 through wssbase+3 re- spectively. r0 and r1 provide access to the indirect registers i0-i31. the third set of registers are extended registers x0-x25 that are indirectly mapped through the wss register i23. i23 acts as both the extended address and extended data register. these extended registers are only avail- able when in mode 3. accessing the x registers requires writing the register address to i23 with xrae set. when xrae is set, i23 changes from an address regis- ter to a data register. subsequent accesses to i23 access the extended data register. to convert i23 back to the extended address register, r0 must be written which internally clears xrae. as- suming the part is in mode 3, the following steps access the x registers: 1. write 17h to r0 (to access i23). r1 is now the extended address register . 2. write the desired x register address to r1 with xrae = 1. r1 is now the extended data register . 3. write/read x register data from r1. to read/write a different x register: 4. write 17h to r0 again. (resets xrae) r1 is now the extended address register . 5. write the new x register address to r1 with xrae = 1. r1 is now the new extended data register . 6. read/write new x register data from r1. address reg. register name wssbase+0 r0 reset address wssbase+1 r1 address/data access i23 indexed address/data extended register access (i23) d7 d6 d5 d4 d3 d2 d1 d0 xa3 xa2 xa1 xa0 xrae xa4 res acf table 16. wss extended register control index register name x0 left line alternate volume x1 right line alternate volume x2 left mic volume x3 right mic volume x4 synthesis and input mixer control x5 right input mixer control x6 left fm synthesis volume x7 right fm synthesis volume x8 left dsp serial port volume x9 right dsp serial port volume x10 right loopback monitor volume x11 dac mute and ifse enable x12 independent adc sample freq. x13 independent dac sample freq. x14 left master digital audio volume x15 right master digital audio volume x16 left wavetable serial port volume x17 right wavetable serial port volume x18-x24 reserved x25 chip version and id table 17. wss extended registers ds213pp4 cs4237b 48
address d7 d6 d5 d4 d3 d2 d1 d0 wssbase+0 r0 init mce trd ia4 ia3 ia2 ia1 ia0 wssbase+1 r1 id7 id6 id5 id4 id3 id2 id1 id0 i23 xa3 xa2 xa1 xa0 xrae xa4 - acf xa4 - xa0d7d6d5d4d3d2d1d0 x0 llaom llaim llabm llag4 llag3 llag2 llag1 llag0 x1 rlaom rlaim rlabm rlag4 rlag3 rlag2 rlag1 rlag0 x2 lmim lmom lmbst lmg4 lmg3 lmg2 lmg1 lmg0 x3 rmim rmom rmbst rmg4 rmg3 rmg2 rmg1 rmg0 x4 mimr lis1 lis0 ifm wtrmd fmrm - - x5 momrris1ris0----- x6 lfmm - lfma5 lfma4 lfma3 lfma2 lfma1 lfma0 x7 rfmm - rfma5 rfma4 rfma3 rfma2 rfma1 rfma0 x8 lspm - lspa5 lspa4 lspa3 lspa2 lspa1 lspa0 x9 rspm - rspa5 rspa4 rspa3 rspa2 rspa1 rspa0 x10 slbe - rlba5 rlba4 rlba3 rlba2 rlba1 rlba0 x11 ldmimrdmimifse----- x12 srad7 srad6 srad5 srad4 srad3 srad2 srad1 srad0 x13 srda7 srda6 srda5 srda4 srda3 srda2 srda1 srda0 x14 ldmom ldmg6 ldmg5 ldmg4 ldmg3 ldmg2 ldmg1 ldmg0 x15 rdmom rdmg6 rdmg5 rdmg4 rdmg3 rdmg2 rdmg1 rdmg0 x16 lwm - lwg5 lwg4 lwg3 lwg2 lwg1 lwg0 x17 rwm - rwg5 rwg4 rwg3 rwg2 rwg1 rwg0 x25 v2 v1 v0 cid4 cid3 cid2 cid1 cid0 table 18. extended register bit summary control registers for the extended registers extended registers: (x0-x17, x25) ds213pp4 cs4237b 49
mic aux1 (line in) aux 2 (cdrom) line (syn.) line out mono out atten. x4l x5r 20db x2l gain x3r min atten. -9db 16 bit d/a mute x14l x15r src pnp isa interface src mono bypass mute x2l, x3r mute i2l, i3r mute i4l, i5r mute i18l, i19r * mute i2l, i3r mute i2l, i3r mute i4l, i5r mute i18l, i19r * gain x2l x3r gain i2l i3r gain i18l * i19r mute i18l, i19r * s s s s s s s s s s s s s s s s s s s s mute x2l, x3r gain i4l i5r s s s s s s s s s s output loopback i0l, i1r s s s s s s mute i26l x4r s atten. i26 mute i26 s mute i26l x5r s s s s s s atten. i6l i7r gain x14l x15r s s s s s s s atten. x6l * x7r fm synthesizer enable x4 s s s s s s s s loopback atten. i13l & (r) s x10 stereo enable x10r s s s s s s s s s s s s s s s s s s s gain i0l i1r s s s s s s mute x11l x11r mute x8l x9r atten. x8l x9r s mute x6l * x7r s mute i6l i7r s s s s s s loopback enable i13 note: the symbol shows the active bit(s) for the register function specified s s dsp audio data serial port dsp serial port mute x16l * x17r gain x16l * x17r s s s s s s wavetable serial port wavetable serial port c8 master volume up/down/mute s analog output mixer * i18/i19 can be remapped to control x6/x7 and x16/x17. if remapping is enabled, x0/x1 control line inputs dsp master digital volume digital mixer analog input mixer 16-bit a/d figure 4. mode 3 mixer (assumes ifm or wten is set) ds213pp4 cs4237b 50
left line alternate volume (x0) default = 11101000 d7 d6 d5 d4 d3 d2 d1 d0 llaom llaim llbam llag4 llag3 llag2 llag1 llag0 llag4-llag0 left line alternate volume. this register is used to control the lline analog input volume to the mixers when i18 is remapped to control fm and/or wavetable serial port vol- ume. the remapping bits are fmrm and wtrmd (x4). the least signifi- cant bit represents 1.5 db, with 01000 = 0 db. see table 10. llabm left line alternate bypass mute. when set to 1, the analog left line input, lline, (bypassing the gain block) to the input mixer is muted. llaim left line alternate input mute. when set to 1, the left line input, lline, from the volume control to the input mixer is muted. laom left line alternate output mute. when set to 1, the left line input, lline, from the volume control to the output mixer is muted. right line alternate volume (x1) default = 11101000 d7 d6 d5 d4 d3 d2 d1 d0 rlaom rlaim rlabm rlag4 rlag3 rlag2 rlag1 rlag0 rlag4-rlag0 right line alternate volume. this register is used to control the rline analog input volume to the mixers when i19 is remapped to con- trol fm and/or wavetable serial port volume. the remapping bits are fmrm and wtrmd in x4. the least significant bit represents 1.5 db, with 01000 = 0 db. see table 10. rlabm right line alternate bypass mute. when set to 1, the analog right line input, rline, (bypassing the gain block) to the input mixer is muted. rlaim right line alternate input mute. when set to 1, the right line input, rline, from the volume control to the input mixer is muted. rlaom right line alternate output mute. when set to 1, the right line input, rline, from the volume control to the output mixer is muted. llag4-g0 lline (synthesis) llaim llaom llabm to output mixer to input mixer +12 to -34.5 db rlag4-g0 rline (synthesis) rlaim rlaom rlabm to output mixer to input mixer +12 to -34.5 db ds213pp4 cs4237b 51
left mic volume (x2) default = 11001111 d7 d6 d5 d4 d3 d2 d1 d0 lmim lmom lmbst lmg4 lmg3 lmg2 lmg1 lmg0 lmg4-lmg0 left microphone gain. the least significant bit represents 1.5 db, wit h 01111 = 0 db. see table 13. lmbst left microphone 20 db boost. when set to 1, the signal to the out- put mixer is given a 20 db boost. lmom left microphone output mixer mute. when set to 1, the signal to the out- put mixer is muted. lmim left microphone input mixer mute. when set to 1, the signal to the in- put mixer is muted. right mic volume (x3) default = 11001111 d7 d6 d5 d4 d3 d2 d1 d0 rmim rmom rmbst rmg4 rmg3 rmg2 rmg1 rmg0 rmg4-rmg0 right microphone gain. the least significant bit represents 1.5 db, wit h 01111 = 0 db. see table 13. rmbst right microphone 20 db boost. when set to 1, the signal to the out- put mixer is given a 20 db boost. rmom right microphone output mixer mute. when set to 1, the signal to the out- put mixer is muted. rmim right microphone input mixer mute. when set to 1, the signal to the in- put mixer is muted. synthesis and input mixer control (x4) default = 100001xx d7 d6 d5 d4 d3 d2 d1 d0 mimr lis1 lis0 ifm wtrmd fmrm res res res reserved. must write 0. could be read as 0 or 1. fmrm fm volume control remap. this bit only functions when ifm = 1. if fmrm = 1, internal fm synthesis volume is controlled by i18/i19 (writes to i18/i19 get remapped to x6/x7). analog line volume is con- trolled by x0/x1. if fmrm = 0, internal fm synthesis volume is controlled by x6/x7 only. wtrmd wavetable volume remap disable. this bit only functions when wten = 1 (c8/global config. byte). if wtrmd = 0, the wavetable serial port volume is controlled by i18/i19 (writes to i18/i19 get remapped to x16/x17). analog line volume is controlled by x0/x1. if wtrmd = 1, the wavetable serial port volume is controlled by x16/x17 only. note: if fmrm = 1, and wtrmd = 0, i18/i19 control both in- ternal fm and wavetable serial port volume. ifm internal fm enable. when set to 1, the internal fm synthesis engine is enabled. setting this bit also changes i6/7 from the master digital audio volume to the isa bus wave volume control. x14/15 becomes the lmg4-g0 lmic input lmim lmom to output mixer to input mixer +22.5 to -22.5 db lmbst +20 db rmg4-g0 rmic input rmim rmom to output mixer to input mixer +22.5 to -22.5 db rmbst +20 db ds213pp4 cs4237b 52
master digital audio volume. this bit can be set through the hardware configuration data in the eeprom. lis1-lis0 left input mixer summer attenuator. this attenuates the inputs to the left input mixer to enable overload pro- tection when multiple input sources are utilized. the least significant bit represents 6 db of attenuation, where 00 yields 0 db of attenuation. see table 8. mimr mono input mute to the right output mixer. when set to 1, the min signal to the right output mixer is muted. right input mixer control (x5) default = 000xxxxx d7 d6 d5 d4 d3 d2 d1 d0 momr ris1 ris0 res res res res res res reserved. must write 0. could be read as 0 or 1. ris1-ris0 right input mixer summer attenuator. this attenuates the inputs to the right input mixer to enable overload protection when multiple input sources are utilized. the least signifi- cant bit represents 6 db of attenuation, where 00 yields 0 db of attenuation. see table 8. momr mono output mute from the right line out, rout, to the mono output mixer. when set to 1, the signal to the mono output mixer from the right line out is muted. left fm synthesis volume (x6) default = 1x000000 d7 d6 d5 d4 d3 d2 d1 d0 lfmm res lfma5 lfma4 lfma3 lfma2 lfma1 lfma0 note: this fm volume register can also be control- led through i18 when ifm = 1 and fmrm = 1. lfma5-lfma0 left internal fm synthesis volume. the least significant bit represents 1.5 db, with 000000 = 0 db. see table 6. res reserved. must write 0. could read as 0 or 1. lfmm left fm mute. when set to 1, the left internal fm input to the digital mixer is muted. right fm synthesis volume (x7) default = 1x000000 d7 d6 d5 d4 d3 d2 d1 d0 rfmm res rfma5 rfma4 rfma3 rfma2 rfma1 rfma0 note: this fm volume register can also be control- led through i19 when ifm = 1 and fmrm = 1. rfma5-rfma0 right internal fm synthesis volume. the least significant bit represents 1.5 db, with 000000 = 0 db. see table 6. res reserved. must write 0. could read as 0 or 1. rfmm right fm mute. when set to 1, the right internal fm input to the digital mixer is muted. left dsp serial port volume (x8) default = 0x000000 d7 d6 d5 d4 d3 d2 d1 d0 lspm res lspa5 lspa4 lspa3 lspa2 lspa1 lspa0 lspa4-lspa0 left dsp serial port attenuation. the least significant bit represents 1.5 db, with 000000 = 0 db. see table 6. res reserved. must write 0. could read as 0 or 1. lfma5-a0 lfmm to digital mixer summer 0 to -94.5 db internal fm synthesizer rfma5-a0 rfmm to digital mixer summer 0 to -94.5 db internal fm synthesizer ds213pp4 cs4237b 53
lspm left dsp serial port mute. when set to 1, the left dsp serial port input (sdin) to the digital mixer is muted. right dsp serial port volume (x9) default = 0x000000 d7 d6 d5 d4 d3 d2 d1 d0 rspm res rspa5 rspa4 rspa3 rspa2 rspa1 rspa0 rspa4-rspa0 right dsp serial port attenuation. the least significant bit represents 1.5 db, with 000000 = 0 db. see table 6. res reserved. must write 0. could read as 0 or 1. rspm right dsp serial port mute. when set to 1, the right dsp serial port input (sdin) to the digital mixer is muted. right loopback monitor volume (x10) default = 0x111111 d7 d6 d5 d4 d3 d2 d1 d0 slbe res rlba5 rlba4 rlba3 rlba2 rlba1 rlba0 rlba5-rlba0 right channel loopback attenuation. these bits determine the attenuation of the loopback from the right adc to the right digital mixer. lbe in i13 must be set to enable loopback. the least significant bit represents -1.5 db, with 000000 = 0 db. see table 6. res reserved. must write 0. could read as 0 or 1. slbe stereo loopback enable. when set to 1, control over the left and right loopback volume is separated. rlba5-rlba0 (x10) control the right channel, and lba5-lba0 (i13) control the left channel. when set to 0, lba5-lba0 (i13) con- trol both channels. dac mute and ifse enable (x11) default = 110xxxxx d7 d6 d5 d4 d3 d2 d1 d0 ldmim rdmim ifse res res res res res res reserved. must write 0. could read as 0 or 1. ifse independent sample freq. enable. when set to 1, the extended registers x12 and x13 are used to set the sample rate, and registers i8, i10 (osm1,0), and i22 are ignored. x12 and x13 cannot be modified un- less this bit is set to 1. rdmim right digital master input mixer mute. when set to 1, the output from the right dac is muted to the right in- put mixer. see figure 4. ldmim left digital master input mixer mute. when set to 1, the output from the left dac is muted to the left input mixer. see figure 4. independent adc fs (x12) default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 srad7 srad6 srad5 srad4 srad3 srad2 srad1 srad0 srad7-srad0 sample rate frequency select for the a/d converter. this register is only in effect (and can only be writ- ten) while ifse=1 in x11. see table 14. lspa5-a0 lspm to digital mixer summer 0 to -94.5 db serial port rspa5-a0 rspm to digital mixer summer 0 to -94.5 db serial port ds213pp4 cs4237b 54
independent dac fs (x13) default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 srda7 srda6 srda5 srda4 srda3 srda2 srda1 srda0 srda7-srda0 sample rate frequency select for the d/a converter. this register is only in effect (and can only be writ- ten) while ifse=1 in x11. see table 15. left master digital audio volume (x14) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 ldmom ldmg6 ldmg5 ldmg4 ldmg3 ldmg2 ldmg1 ldmg0 this register becomes the master digital audio vol- ume control for the left channel when either ifm or wten is set to one. ldmg6-ldmg0left digital master mixer attenuation. the least significant bit represents 1.5 db, with 000000 = 0 db. see table 12. ldmom left digital master output mixer mute. when set to 1, the output of the left dac is muted to the left output mixer. right master digital audio volume (x15) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 rdmom rdmg6 rdmg5rdmg4rdmg3rdmg2rdmg1rdmg0 this register becomes the master digital audio vol- ume control for the left channel when either ifm or wten is set to one. rdmg6-rdmg0 right digital master mixer attenu- ation. the least significant bit represents 1.5 db, with 000000 = 0 db. see table 12. rdmom right digital master output mixer mute. when set, the right dac output is muted to the right output mixer. +12 to -34.5db dac ldmom ldmim to input mixer to output mixer 0 to -60db analog digital ldmg6-g0 from digital mixer summer note: this bit is controlled by register (x11) +12 to -34.5db dac rdmom rdmim to input mixer to output mixer 0 to -60db analog digital rdmg6-g0 from digital mixer summer note: this bit is controlled by register (x11) ds213pp4 cs4237b 55
left wavetable serial port volume (x16) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 lwm res lwg5 lwg4 lwg3 lwg2 lwg1 lwg0 this wavetable volume register can also be control- led through i18 when wten=1 (c8 or global config. byte) & wtrmd=0 (x4). lwg5-lwg0 left wavetable serial port gain. least significant bit represents 1.5 db, with 01000 = 0 db. see table 6. res reserved. must write 0. could read as 0 or 1. lwm left wavetable serial port mute. when set, the left wavetable serial input to the digital mixer is muted. right wavetable serial port volume (x17) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 rwm res rwg5 rwg4 rwg3 rwg2 rwg1 rwg0 this wavetable volume register can also be control- led through i19 when wten=1 (c8 or global config. byte) & wtrmd=0 (x4). rwg5-rwg0 right wavetable serial port gain. least significant bit represents 1.5 db, with 01000 = 0 db. see table 6. res reserved. must write 0. could read as 0 or 1. rwm right wavetable serial port mute. when set, the right wavetable se- rial input to the digital mixer is muted. chip version and id (x25) default = 11001000 d7 d6 d5 d4 d3 d2 d1 d0 v2 v1 v0 cid4 cid3 cid2 cid1 cid0 this register was added to revision c silicon. in revi- sion b, this register read 0x00. cid5-cid0 chip identification. distinguishes between this chip and other codec chips that support this register set. this register is identical to c1 and replaces the id register in i25. 00000 - cs4237b, revision b 01000 - cs4237b v2-v0 version number. as enhancements are made, the version number is changed so software can distinguish between the different versions of the same chip. 000 - revision b 110 - revision c/d 111 - revision e ds213pp4 cs4237b 56
sound blaster interface the sound blaster pro compatible interface is the third physical device in logical device 0. since the wss codec and the sound blaster are mutually exclusive, the wss codec interrupt and playback dma channel are shared with the sound blaster interface. to map volume controls properly, the external devices: synthesizer (when used), cdrom, etc., must be connected to the proper analog inputs as illustrated in figure 5. mode switching to facilitate switching between different func- tional modes (i.e. sound blaster and windows sound system), logic is included to handle the switch transparently to the host. no special soft- ware is required on the host side to perform the mode switch. sound blaster direct register interface the sound blaster software interface utilizes 10- bit address decoding and is compatible with sound blaster and sound blaster pro interfaces. 10-bit addressing requires that the upper address bits be 0 to decode a valid address, i.e. no alias- ing occurs. this device requires 16 i/o locations located at the pnp address sbbase. the follow- ing registers, shown in table 19, are provided for sound blaster compatibility. left/right fm registers, sbbase+0 - sbbase+3 these registers are mapped directly to the appro- priate fm synthesizer registers. mixer address register, sbbase+4, write only this register is used to specify the index address for the mixer. this register must be written be- fore any data is accessed from the mixer registers. the mixer indirect register map is shown in table 20. address description type sbbase+0 left fm status port read sbbase+0 left fm register status port write sbbase+1 left fm data port write only sbbase+2 right fm status port read sbbase+2 right fm register status port write sbbase+3 right fm status port write only sbbase+4 mixer register address write only sbbase+5 mixer data port read/write sbbase+6 reset write only sbbase+8 fm status port read only sbbase+8 fm register port write sbbase+9 fm data port write only sbbase+a read data port read only sbbase+c command/write data write sbbase+c write buffer status (bit 7) read sbbase+e data available status (bit 7) read table 19. sound blaster pro compatible i/o interface ds213pp4 cs4237b 57
v o l d a c a d c dig voice mic aux1 line a u x 1 l i n e v o l mic cd line fm vol pc speaker mono in line out s v o l s a u x 2 dig attn figure 5. sbpro mixer mapping register d7 d6 d5 d4 d3 d2 d1 d0 00h data reset 02h reserved 04h voice volume left voice volume right 06h reserved 08h reserved 0ahxxxxx mic mixing 0ch x x x input select x 0ehxxxxxxvstcx 20h reserved 22h master volume left master volume right 24h reserved 26h fm volume left fm volume right 28h cd volume left cd volume right 2ah reserved 2ch reserved 2eh line volume left line volume right table 20. sbpro compatible mixer interface ds213pp4 cs4237b 58
mixer data register, sbbase+5 this register provides read/write access to a par- ticular mixer register depending on the index address specified in the mixer address register. reset sbbase+6, write only when bit d[0] of this register is set to a one and then set to a zero, a reset of the sound blaster interface will occur. read data port sbbase+a, read only when bit d[7] of the data available register, sbbase+e, is set =1 then valid data is available in this register. the data may be the result of a command that was previously written to the command/write data register or digital audio data. command/write data sbbase+c, write only the command/write data register is used to send sound blaster pro commands. write buffer status, sbbase+c, read only the write buffer status register bit d[7] indi- cates when the sbpro interface is ready to accept another command to the command/write data register. d[7]=1 indicates ready. d[7]=0 in- dicates not ready. sound blaster mixer registers the sound blaster mixer registers are shown in table 20. the sound blaster mixer to wss codec mixer mapping is shown in figure 5. reset register, mixer index 00h writing any value to this register will reset the mixer to default values. vo i c e vo l u m e r e g i s t e r, mixer index 04h, default = 99h this register provides 8 steps of voice volume control each for the right and left channels. microphone mixing register, mixer index 0ah, default = 01h this register provides 4 steps of microphone vol- ume control. input control register, mixer index 0ch this register selects the input source to the adc. d2,d1 - 00 - microphone 01 - cd audio 10 - microphone 11 - line in output control register, mixer index 0eh vstc - 0 - mono mode 1 - stereo mode master volume register, mixer index 22h, default = 99h this register provides 8 steps of master volume control each for the right and left channels. fm volume register, mixer index 26h, default = 99h this register provides 8 steps of fm volume control each for the right and left channels. cd volume register, mixer index 28h, default = 01h this register provides 8 steps of cd volume control each for the right and left channels. line-in volume register, mixer index 2eh, default = 01h this register provides 8 steps of line-in volume control each for the right and left channels. ds213pp4 cs4237b 59
game port interface the game port logical device software interface utilizes 10-bit address decoding and is located at pnp address gamebase. 10-bit addressing re- quires that the upper address bits be 0 to decode a valid address, i.e. no aliasing occurs. for back- wards compatibility, the game port consists of 8 i/o locations where the lower 6 alias to the same location, which consists of one read and one write register. plug and play configuration capability will allow the joystick i/o base address, gamebase, to be located anywhere within the host i/o address space. currently most games software assume that the joystick i/o port is located at 200h. a write to the gamebase register triggers four timers. a read from the same register returns four status bits corresponding to the joystick fire buttons and four bits that correspond to the out- put from the four timers. a button value of 0 indicates the button is pressed or active. the button default state is 1. when gamebase is written, the x/y timer bits go high. once gamebase is written, each timer output remains high for a period of time deter- mined by the current joystick position. the number in parenthesis below is the joystick con- nector pin number. gamebase+0 - gamebase+5 d7 d6 d5 d4 d3 d2 d1 d0 jbb2 jbb1 jab2 jab1 jbcy jbcx jacy jacx jacx joystick a, coordinate x (pin 3) jacy joystick a, coordinate y (pin 6) jbcx joystick b, coordinate x (pin 11) jbcy joystick b, coordinate y (pin 13) jab1 joystick a, button 1 (pin 2) jab2 joystick a, button 2 (pin 7) jbb1 joystick b, button 1 (pin 10) jbb2 joystick b, button 2 (pin 14) two bits, jr1 and jr0, are located in the con- trol register space (ctrlbase+0) for defining the speed of the game port interface. four dif- ferent rates are software selectable for use with various joysticks and to support older software timing loops with aliasing (roll-over) problems. gamebase+6 d7 d6 d5 d4 d3 d2 d1 d0 resresresresresresresres res must not write any value to this register. may read any value. gamebase+7 d7 d6 d5 d4 d3 d2 d1 d0 resresresresresresresres res must not write any value to this register. may read any value. the game port hardware interface consists of 8 pins that connect directly to the standard game port connector. buttons must have a 4.7 k w pul- lup resistor and a 1000 pf capacitor to ground. x/y coordinates must have a 5.6 nf capacitor to ground and a 2.2 k w series resistor to the appro- priate joystick connector pin. for a detailed hardware description, see the reference design data sheet. ds213pp4 cs4237b 60
control interface the control logical device includes registers for controlling various functions of the part that are not included in the other logical device blocks. these functions include game port rate control and programmable power management, as well as extra mixing functions. control register interface the control logical device software interface oc- cupies 8 i/o locations, utilizes 12-bit address decoding, and is located at pnp address ctrlbase. if the upper address bits, sa12- sa15 are used, they must be 0 to decode a valid address. this device can also support an inter- rupt. table 21 lists the eight control registers. joystick and power control ctrlbase + 0, default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 pm1 pm0 consw pdc pdp pdm jr1 jr0 jr1,0 joystick rate control. selects operating speed of the joystick (changes the trigger threshold for the x/y coordi- nates). 00 - slowest speed 01 - medium slow speed 10 - medium fast speed 11 - fastest speed pdm power down mixer. when set, the analog mixer is powered down and all mixer control registers (in wssbase space) are reset to de- fault values. pdp* power down processor. when set, places the internal processor in an idle state. this effects the pnp inter- face, mpu-401, and sbpro devices. pdc* power down codec. when set, adcs and dacs are powered down. consw controls host interrupt generation when a context switch occurs 0 - no interrupt on context switch 1 - control interrupt generated on context switch pm1,0 power management. these bits are provided for backwards compatibility. for new designs, the bits in ctrlbase+2 should be used. 00 - all functions active. 01 - a/d and d/a powered down. mixer still active, but volume reg- isters are frozen. disables pdc and pdm bits. 10 - full part power down. all functions are disabled except reads and writes to this register. all internal logic, including pnp config. registers are reset. to exit this power-down mode, pm1/0 must be reset, through ctrlbase+ 0, and then the entire chip must be reinitialized. 11* - wss codec, sbpro, mpu-401, and pnp interfaces, and the analog mixer are powered down. * note: the sbpro, pnp, and mpu-401 interfaces are linked together. setting pm1,0 or pdp will power all three interfaces down; however, if any one of the interfaces is written to, they will all power back up automatically. pm1,0 and pdp always reflects the value written, not whether the three devices are pow- ered up or not. address register ctrlbase+0 joystick & power control ctrlbase+1 e 2 prom interface ctrlbase+2 block power down ctrlbase+3 control indirect address reg. ctrlbase+4 control indirect data register ctrlbase+5 control/ram access ctrlbase+6 ram access end ctrlbase+7 global status table 21. control logical device registers ds213pp4 cs4237b 61
e 2 prom interface ctrlbase+1, default = 10000000 d7 d6 d5 d4 d3 d2 d1 d0 ich ish adc1 adc0 imh din/ een dout clk clk this bit is used to generate the clock for the plug and play e 2 prom. een must be set to 1 to make this bit operational. dout this bit is used to output serial data to the plug and play e 2 prom. een must be set to 1 to make this bit op- erational. din/een when read (din), this bit reflects the xd0 pin, which should be serial data output from the plug and play e 2 prom. een and dout must be 1 for this bit to function. when written (een), enables the e 2 prom interface: clk and dout onto the peripheral port pins. writing: 0 - e 2 prom interface disabled 1 - e 2 prom interface enabled imh* interrupt polarity - modem. when set, the mint pin is an active high sig- nal. when low, mint is an active low signal. adc1,0 these two bits are used to control an additional a/d mux and enable for an analog loopback path. these two mixing paths provide karaoke support. these bits are provided for backwards compatibility. new soft- ware should use the mic volume control in mode 3 registers x2/x3 to support mic mix to the output mixer. see figure 6. 00 - normal. a/d input from the input mux. 01 - codec input mux is mixed into output mixer. a/d input is from the input mux. this facilitates the mic mixed to output, but only mic recorded. 10 - codec input mux is mixed into output mixer. a/d input is from line outputs. this facilitates the mic mixed to output, and the output recorded by the adcs. 11 - reserved. ish* interrupt polarity - external synthe- sizer. when set, the sint pin is an active high signal. when low, sint is an active low signal. ich* interrupt polarity - cdrom. when set, the cdint pin is an active high sig- nal. when low, cdint is an active low signal. * note: these bits can be initialized through the hardware configuration data. figure 6. mode 2 mixer addition ds213pp4 cs4237b 62
block power down ctrlbase+2, default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 pdwn src vref mix adc dac proc fm fm internal fm synthesizer powered down when set. proc processor set to idle mode. when set, places the internal processor in an idle state. this effects the pnp inter- face, mpu401, and sbpro devices. any command to any one of these interfaces will cause the processor to go active. dac dac power down. when set, powers down the d/a converters, serial ports, and internal fm synthesizer. the dacs should be muted prior to setting this bit to prevent audible pops. adc adc power down. when set, powers down the a/d converters. mix mixer power down. all analog input and output channels are powered down, except min and mout (as- suming vref is not powered down). if mix is 1 and vref is 0, the mby bit in the wss i26 register is forced on. the outputs should be muted prior to setting this bit to prevent audible pops. vref vref power down. when set, powers down the entire mixer. since powering down vref, powers down the entire analog section, some audi- ble pops can occur. src internal sample-rate converters are powered down. only 44.1 khz sam- ple frequency is allowed when this bit is set. pdwn global power down. when set, the entire chip is powered down, except reads and writes to this register. when this bit is cleared, a full cali- bration is initiated. all registers retain their values; therefore, normal opera- tion can resume after calibration is completed. when clearing this bit, the internal processor stays in power- down until accesses occur to processor interface (sound blaster, mpu, or pnp accesses). if hardware volume control is enabled, this bit should be written to 0 twice causing the processor to go active (which reenables the hardware volume). note: software should mute the dacs and mixers and fm volume when asserting any power down modes to prevent clicks and pops. control indirect address register ctrlbase+3 d7 d6 d5 d4 d3 d2 d1 d0 res res res res ca3 ca2 ca1 ca0 ca3-ca0 address bits to access the control indirect registers c0-c8 through ctrlbase+4 res reserved. could read as 0 or 1. must write as 0. control indirect data register ctrlbase+4 d7 d6 d5 d4 d3 d2 d1 d0 cd7 cd6 cd5 cd4 cd3 cd2 cd1 cd0 cd7-cd0 control indirect data register. this register provides access to the indi- rect registers c0-c8, where ctrlbase+3 selects the actual reg- ister. see the control indirect register section for more details. ds213pp4 cs4237b 63
control/ram access ctrlbase+5, default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 cr7 cr6 cr5 cr4 cr3 cr2 cr1 cr0 cr7-cr0 this register controls the loading of the part?s internal ram. ram sup- port includes hardware configuration and pnp default resource data, as well as program memory. see the hostload procedure section for more information. commands are followed by address and data information. commands: 0x55 - disable pnp key 0x56 - disable crystal key 0x57 - jump to rom 0x5a - update hardware configura- tion data. 0xaa - download ram. address followed by data. (stopped by writ- ing 0 to ctrlbase+6) ram access end ctrlbase+6, default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 re7 re6 re5 re4 re3 re2 re1 re0 re7-re0 a 0 written to this location resets the previous location, ctrlbase+5, from data download mode to com- mand mode. global status ctrlbase+7, default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 cwss ictrl isb iwss impu res res res res reserved. could read as 0 or 1. impu mpu-401 interrupt status. 0 - no interrupt pending 1 - an interrupt is pending iwss windows sound system interrupt status. 0 - no interrupt pending 1 - an interrupt is pending isb sound blaster interrupt status. 0 - no interrupt pending 1 - an interrupt is pending ictrl control logical device 2 interrupt status. interrupts are generated on a context switch between wss and sbpro modes. 0 - no interrupt pending 1 - an interrupt is pending cwss context - wss. indicates the current context. 0 - sound blaster emulation 1 - windows sound system ds213pp4 cs4237b 64
control indirect registers the control indirect registers are accessed through ctrlbase+3 and ctrlbase+4. ctrlbase+3 is the address register and ctrlbase+4 is the data register used to access c0 through c8 indirect registers. wss master control (c0) default = 0xxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 rwss res res res res res res res res reserved. must write 0. could read as 0 or 1. rwss reset wss registers. setting this bit forces the wss registers to zero, then clearing this bit forces the wss registers to their default state. version / chip id (c1) default = 11001000 d7 d6 d5 d4 d3 d2 d1 d0 v2 v1 v0 cid4 cid3 cid2 cid1 cid0 cid4-cid0 chip identification. distinguishes between this chip and other codec chips that support this register set. this register is identical to the wss x25 register. 01000 - cs4237b v2-v0 version number. as enhancements are made, the version number is changed so software can distinguish between the different versions of the same chip. 100 - revision a 101 - revision b 110 - revision c/d 111 - revision e address register name ctrlbase+3 control indirect address ctrlbase+4 control indirect data table 22. control indirect access registers index register name c0 wss master control c1 version / chip id c2 3d space and center c3 3d enable c4 consumer serial port enable c5 lower channel status c6 upper channel status c7 reserved c8 cs9236 wavetable control table 23. control indirect registers ds213pp4 cs4237b 65
3d space and center (c2) default = 00000000 d7 d6 d5 d4 d3 d2 d1 d0 spc3 spc2spc1spc0ctr3ctr2ctr1ctr0 ctr3-ctr0 srs processed "center" gain term. the least significant bit represents 1.5 db attenuation, with 0000=0 db. see table 24. when 3dm is on, this value is forced to 0000. spc3-spc0 srs processed "space" gain term. the least significant bit represents 1.5 db attenuation, with 0000=0 db. see table 24. when 3dm is on, this value is forced to 0010. 3d enable (c3) default = 000xxxxx d7 d6 d5 d4 d3 d2 d1 d0 3den 3dm 3dso res res res res res res reserved. must write 0. could read as 0 or 1. 3dso 3d serial output. when set, sdout data comes from the dac inputs which includes 3d effects. typically used when cspe in c4 is set and determines the data used on the consumer serial port output pin. 0 - the output is from the adcs. 1 - the output is from the srs dsp. 3dm 3d mono enable. when set, the srs mono-to-stereo dsp is enabled. (3den must also be enabled). this allows a mono signal to be srs processed into a pseudo stereo im- age. 3den 3d enable. must be set to enable the srs 3d sound dsp. consumer serial port enable (c4) default = 0000xxxx d7 d6 d5 d4 d3 d2 d1 d0 cspe csbr u v res res res res v the validity bit in a sub-frame of digital audio data. u the user bit in a sub-frame of digital audio data. csbr channel status block reset. when set, resets the channel status block boundary. cspe consumer serial port enable. when set, the serial port output format, on sdout, converts to the consumer standard for digital audio transmis- sion, compatible with the consumer portion of iec-958. an older version of the standard is also called s/pdif. note that the serial port is still enabled using the spe bit in wss i16. for more information on the consumer digital audio transmis- sion format see crystals application note 22 titled overview of digital audio interface data structures . bit3 bit2 bit1 bit0 space (spc3-spc0) center (ctr3-ctr0) 00 0 0 0 0.0 db 0.0 db 10 0 0 1 -1.5 db -1.5 db 20 0 1 0 -3.0 db -3.0 db 30 0 1 1 -4.5 db -4.5 db .. . . . -- 81 0 0 0 -12.0 db -12.0 db .. . . . -- 12 1 1 0 0 -18.0 db -18.0 db 13 1 1 0 1 -19.5 db -19.5 db 14 1 1 1 0 -21.0 db -21.0 db 15 1 1 1 1 -22.5 db -22.5 db table 24. srs 3d sound control ds213pp4 cs4237b 66
lower channel status (c5) d7 d6 d5 d4 d3 d2 d1 d0 cs9 cs8 cs5 cs4 cs3 cs2 cs1 res res reserved. must write 0. could read as 0 or 1. cs1 channel status bit 1: audio. when clear, indicates that the transmitted data is digital audio and suitable for conversion to an analog signal. 0 - digital audio 1 - non-audio data cs2 channel status bit 2: copy/copyright this bit, along with the l bit and the category codes, form the scms copy protection scheme. 0 - copy inhibited/copyright asserted 1 - copy permitted/copyright not asserted. cs4, cs3 channel status bits 4,3: pre-emphasis 00 - none 01 - 50/15 m s - 2 channel audio cs5 channel status bit 5: lock 0 - source fs locked 1 - source fs unlocked. cs8, cs9 the first two bits of the category code. see the next register description for more details. note: more information on copy protection can be found in the sanchez aes paper titled an under- standing and implementation of the scms serial copy management system for digital audio trans- mission. upper channel status (c6) d7 d6 d5 d4 d3 d2 d1 d0 cs25 cs24 cs15 cs14 cs13 cs12 cs11 cs10 cs8-cs14 category code channel status bits. note: cs8 and cs9 are in the pre- vious register. these bits define the type of product transmitting and are used in the scms copy protection scheme to interpret the l bit. 0000000 - general 0000001 - experimental 0001xxx - solid state memory 001xxxx - broadcast 010xxxx - digital/digital converters 01100xx - adcs w/o copy protection 01101xx - adcs with copy protection 0111xxx - broadcast 100xxxx - laser-optical 101xxxx - musical instruments 110xxxx - magnetic tape or disk 111xxxx - reserved. cs15 l or generation status. this bit changes polarity based on the cate- gory codes above. for most categories: 0 - no indication, 1st generation or higher. 1 - original/commercially pre- recorded data. the above definition is reversed for category codes: 001xxxx - broadcast 0111xxx - broadcast 100xxxx - laser-optical cs25, cs24 channel status bits 25, 24. sample frequency. 00 - 44.1 khz sample frequency. this is the only fs supported. reserved (c7) d7 d6 d5 d4 d3 d2 d1 d0 res res res res res res res res res reserved. must write 0. could read as 0 or 1. ds213pp4 cs4237b 67
cs9236 wavetable control (c8) default = xxxx0000 d7 d6 d5 d4 d3 d2 d1 d0 res res res res wten sps dmclk bres bres force breset low. when set, the breset pin is forced low. typically used for power management of pe- ripheral devices. dmclk disable mclk. when set, the mclk pin of the cs9236 wavetable syn- thesizer serial interface is forced low providing a power savings mode. sps dsp serial port switch. when set, switches the dsp serial port pins from the 2nd joystick to the xd4- xd1 pins. when spe in i16 is set, xd4-xd1 convert to the dsp serial port pins. once sps is enabled, the sd<7:0> bus will not be driven when accesses occur to peripheral port de- vices. sps can also be set in the e 2 prom hardware configuration data, global configuration byte. wten wavetable serial port enable. when, set, forces xd7-xd5 pins to convert to the cs9236 single-chip wave- table music synthesizer serial port pins. once wten is enabled, the sd<7:0> bus will not be driven when accesses occur to peripheral port de- vices. wten can also be set in the e 2 prom hardware configuration data, global configuration byte. setting this bit also changes i6/i7 from the master digital audio volume to the isa bus wave volume control. x14/15 becomes the master digital audio volume. res reserved. must write 0. could read as 0 or 1. srs 3d sound overview the srs 3d stereo dsp engine is designed to retrieve and restore spacial information, direc- tional cues, and other sonic nuances which are either missing or altered by the electronic repro- duction of stereo and/or the microphone mixing process. srs 3d mono processing, when used in conjunction with the srs 3d stereo system, synthesizes a 3d stereo signal from a monaural source. srs stands for sound retrieval system. it dif- fers from stereo and other sound expansion techniques because it is based on the human hearing system. the ears are complex instru- ments that allow us to hear in three dimensions. microphones and traditional stereo playback sys- tems only produce flat, two dimensional sound images which are somewhat limited compared to "real live sound". srs compensates for these limitations by re-establishing the necessary infor- mation that allows us to hear in three dimensions. the results are surprisingly close to real live sound. srs is unique because it does not rely on special recording techniques. it works with any audio signal whether it is mono, stereo, surround sound, or even signals encoded with a sound-en- hancement process. most importantly, srs does not alter the original program material by adding any form of time delay, phase shift, or harmonic distortion. with srs 3d sound there is no critical listening position or sweet spot. the listener can move around the room and continue to be immersed in full three-dimensional sound. speakers are no longer the discernible point source of sound. srs is a patented process that differs from ste- reo and surround sound in that it works with any existing recorded material: mono, stereo, sur- round-encoded, or other encoding technologies. srs is not required in the recording process. this means a listener?s entire audio library can be enhanced by srs by simply playing it through the cs4237b crystal chip. like stereo, any two-speaker stereo system is adequate. ds213pp4 cs4237b 68
hearing basics it has long been known that the hearing system uses several methods to determine from which direction a particular sound is coming. since hu- man hearing is binaural (two ears), these methods include relative phase shift for low fre- quency sounds, relative intensity for sounds in the voice range, and relative time of arrival for sounds having fast rise times and high frequency components. the outer ear plays a significant role in the de- termination of direction. due to the complex nature of the ear?s shape, sound is subject to re- flection, reinforcement, and cancellation at various frequencies. effectively, the human hear- ing system functions as a multiple filter, emphasizing some frequencies, attenuating oth- ers, and letting some get through with no change. the response changes with both azimuth and elevation, and together with the binaural ca- pabilities helps determine whether a sound is coming from up, down, left, right, ahead, or be- hind. the frequency response of microphones is not dependent on azimuth in the same way as the ear. omni-directional microphones exhibit flat response in all directions. cardioid microphones exhibit flat response to sounds coming from the front and sides and are dead at the rear. as no microphone behaves like the human ear, the sounds picked up by a microphone are accurate as far as the microphone is concerned but are not the same as the sounds impinging on the human eardrum under similar circumstances. when the sound is reproduced by speakers, the situation is further altered by speaker location. if sounds which originally came from one side or the other are reproduced by speakers which are frontally located, these side sounds are heard with the incorrect spectral response. the same is true for frontal sounds which are coming from side-mounted loudspeakers. the result is spacial distortion of the sound field which prevents the user from hearing what was originally performed with the proper spatial cues. the srs 3d stereo process the crystal srs dsp, illustrated in figure 7, processes the signal in such a manner that the spacial cues lost in the record/playback process are restored. since the human hearing system is involved and is actually part of the loop, its transfer function is made part of the system transfer function. at the same time, srs 3d ste- reo processing avoids an objectionable buildup of frequencies of increased phase sensitivity and is effective over a wide area so that the listener is not restricted to a favorable listening position (sweet spot) between two speakers. in the stereophonic signal, frontal sounds pro- duce equal amplitudes in the left and right channels and are therefore present in the "sum" or l+r signal. ambient sounds, which include reflected and side sounds, produce a complex sound field and do not appear equally in the left and right channels. they are therefore present in the "difference" or l-r signal. although these two signals are normally heard as a composite signal, it is possible to separate and process them independently and then remix them into a new composite signal which contains the required spatial cues that the stereo recording and play- back processes do not provide. the directional cues are mostly contained in the difference sig- nals, so these can be processed, (l-r)p, to bring the missing directional cues back to their normal levels. the processed difference signal can then be increased in amplitude, using spc3-0, in or- der to increase apparent image width. srs space control the srs space adjustment, spc3-0 in c2, con- trols the amount of processed difference signal, (l-r)p, that is added to the final left and right digital signals going to the dacs. the difference ds213pp4 cs4237b 69
signal contains the spatial information that al- lows us to perceive sounds from coming all around and the directional cues that we use to determine the localization of those sounds. turning up the space control increases the amount of corrected directional information, re- stores the proper localization of the original sounds, and expands the width of the overall sound stage. turning down the space control re- sults in having no processed difference signal component and thus limits the intensity of these effects. when srs 3d sound is first turned on (3den in c3), the space control (spc3-spc0) should be adjusted before the center control. space should be set to approximately 75% (spc3-0 = 0011, or -4.5 db) with the center control set to 50%. as the level of space is increased, the sound stage expands both in width and depth. the proper lis- tening level is subjective and program dependent. if centered sound information (such as vocals) seem too low as a result of the space control setting, they can be adjusted using the center control. if adjusting the space control yields no change in the sound image, the input signal is probably mono and the mono-to-stereo switch, 3dm, should be enabled. srs center control the srs center adjustment, ctr3-0 in c2, de- termines the amount of sum signal (l+r) that is added to the final left and right digital signals going to the dacs. the sum signal contains in- formation common to both channels that is intended to appear in front or at the center of the sound stage. vocals, dialog, solo instruments, bass, and kick drums are examples of sounds that are often placed at the center. when srs 3d sound is first turned on (3den in c3), the space control should be adjusted before the center control (ctr3-0). space should be set to approximately 75% with the center con- trol set to 50% (ctr3-0 = 1000, or -12.0 db). turning up the center control emphasizes the centered sounds so that their perceived level is increased and they are brought out and into the center of the room. once space is set, the center control should be adjusted to provide a pleasant balance between the ambient sounds and the centered sounds. digital mixer stereo 16-bit d - s dac perspective correction s s l l+r l-r r (l-r)p 3den to analog mixers spc3-0 ctr3-0 master digital volume figure 7. srs block diagram ds213pp4 cs4237b 70
srs mono-to-stereo synthesis in addition to creating 3d stereo images from stereo program material, the 3dm bit in c3 ex- pands monaural signals to a wider image format. the first step in the conversion of a monaural audio signal to 3d sound is the creation of a synthetic stereo signal. this is accomplished in the srs 3d mono system (3dm=1) through a technique that makes use of constant phase fil- ters. the original mono signal is applied to two banks of filters which create two outputs with one shifted 90 degrees relative to the other. due to the precedence effect, the ear will perceive the leading signal as the direct sound (analogous to l+r) and the lagging signal as ambience infor- mation (analogous to l-r or difference signal). the lead and lag signals are dematrixed using conventional sum and difference techniques, into synthetic left and right stereo signals. these sig- nals are then applied to the srs 3d stereo process. because the synthetic l, r, l+r, and processed l-r signals are generated synthetically from a mono input, their relationships remain constant, and user control of the l+r and l-r signal levels ("center" and "space") are not re- quired and are internally fixed. consumer iec-958 digital output the cs4237b supports the industry standard iec-958 consumer digital interface. sometimes this standard is referred to s/pdif which refers to an older version of this standard. this output provides an interface, external to the pc, for storing digital audio (as in a dat or recordable cd-rom) or playing digital audio from digital speakers. the interface is enabled by turning on the cspe bit in c4 and spe in i16. the data is sent out the sdout dsp serial interface pin. the other dsp serial interface pins still function properly when sdout is used for the iec-958 interface. the sdout pin can either be on joystick b?s cx pin or it can be on the peripheral port data bus pin xd3, controlled by the sps bit in the hardware configuration data or register c8. the data going out sdout can come from the adc or from the dac interface (which includes qsound 3d sound if enabled). this functionality is controlled by the 3dso bit in register c3. for the receiving device to function properly, the channel status bits in c5 and c6 must be set properly. see the sanchez aes paper an under- standing and implementation of the scms serial copy management system for digital audio transmission for more details on setting the channel status information. figure 8 illustrates the circuit necessary for im- plementation of the iec-958 consumer interface. an external buffer is required to drive the cur- rent needed to drive the 75 w interface (415 w or 12 ma). the transformers can be obtained from: pulse engineering telecom products group san diego, ca (619) 268-2400 or schott corporation wa y za ta, m n (612) 475-1173 sdout rca phono 374 w 90.9 w figure 8. iec-958 consumer interface ds213pp4 cs4237b 71
mpu-401 interface the mpu-401 is an intelligent midi interface that was introduced by roland in 1984. voyetra technologies subsequently introduced an ibm- pc plug in card that incorporated the mpu-401 functionality. the mpu-401 has become the de- facto standard for controlling midi devices via ibm-pc compatible personal computers. although the mpu-401 does have some intelli- gence, a non-intelligent mode is available in which the mpu-401 operates as a basic uart. by incorporating hardware to emulate the mpu- 401 in uart mode, midi capability is supported. mpu-401 register interface the mpu401 logical device software interface occupies 2 i/o locations, utilizes 10-bit address decoding, and is located at pnp address mpubase. 10-bit addressing requires that the upper address bits be 0 to decode a valid ad- dress, i.e. no aliasing occurs. the standard base address is 330h. this device also uses an inter- rupt, typically 9. the pnp alignment for the mpu-401 must be a multiple of 8. mpubase+0 is the midi transmit/receive port and mpubase+1 is the command/status port. in addition to i/o decodes the only additional func- tionality required from an isa bus viewpoint is the generation of a hardware interrupt whenever data has been received into the receive buffer. midi transmit/receive port, mpubase+0, default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 tr7 tr6 tr5 tr4 tr3 tr2 tr1 tr0 tr7-tr0 the midi transmit/receive port is used to send and receive midi data as well as status information that was returned from a previously sent command. all midi transmit data is transferred through a 16-byte fifo and receive data through a 16-byte fifo. the fifo gives the isa interface time to respond to the asynchronous midi transfer rate of 31.25k baud. the command/status registers occupy the same address and are used to send instructions to and receive status information from the mpu-401. command register, write only mpubase+1 d7 d6 d5 d4 d3 d2 d1 d0 cs7 cs6 cs5 cs4 cs3 cs2 cs1 cs0 cs7-cs0 each write to the command/status register must be monitored and the appropriate acknowledge generated. status register, read only mpubase+1, default = xxxxxxxx d7 d6 d5 d4 d3 d2 d1 d0 rxs txs cs5 cs4 cs3 cs2 cs1 cs0 cs5-cs1 d0-d5 are the 6 lsbs of the last command written to this port. txs transmit buffer status flag. 0 - transmit buffer not full 1 - transmit buffer full rxs receive buffer status flag 0 - data in receive buffer 1 - receive buffer empty when in "uart" mode, data is received into the receive buffer fifo and a hardware interrupt is generated. data can be received from two sources: midi data via the uart serial input or acknowledge data that is the result of a write to the command register (mpubase+1). the inter- rupt is cleared by a read of the midi receive port (mpubase+0). ds213pp4 cs4237b 72
midi uart the uart is used to convert parallel data to the serial data required by midi. the serial data rate is fixed at 31.25k baud ( 1%). the serial data format is rs-232 like: 1 start bit, 8 data bits, and 1 stop bit. in multimedia systems, the midi pins are typi- cally connected to the joystick connector. see the reference design data sheet for detailed infor- mation. mpu-401 "uart" mode operation after power-up reset, the interface is in "non- uart" mode. non-uart mode operation is defined as follows: 1. all writes to the transmit port, mpubase+0, are ignored. 2. all reads of the receive port, mpubase+0, return the last received buffer data. 3. all writes to the command port, mpubase+1, are monitored and acknowledged as follows: a. a write of 3fh sets the interface into uart operating mode. an acknowledge is generated by putting an feh into the receive buffer fifo which generates an interrupt. b. a write of a0-a7, abh, ach, adh, afh places an feh into the receive buffer fifo (which generates an interrupt) fol- lowed by a one byte write to the receive buffer fifo of 00h for a0-a7, and abh commands, 15h for ach, 01h for adh, and 64h for afh commands. c. all other writes to the command port are ignored and an acknowledge is gener- ated by putting an feh into the receive buffer fifo which generates an interrupt. uart mode operation is defined as follows: 1. all writes to the transmit port, mpubase+0, are placed in the transmit buffer fifo. whenever the transmit buffer fifo is not empty, the next byte is read from the buffer and sent out the midout pin. the status register, mpubase+1, bit 6, txs is updated to reflect the transmit buffer fifo status. 2. all reads of the receive port, mpubase+0, return the next byte in the receive buffer fifo. when serial data is received from the midin pin, it is placed in the next receive buffer fifo location. if the buffer is full, the last location is overwritten with the new data. the status register, mpubase+1, bit 7, rxs is updated to reflect the new re- ceive buffer fifo state. 3. a write to the command register, mpubase+1, of ffh will return the interface to non-uart mode. 4. all other writes to the command register, mpubase+1, are ignored. fm synthesizer (internal) this part contains a games-compatible internal fm synthesizer. when enabled, this internal fm synthesis engine responds to both the sbpro fm synthesis addresses as well as the synbase ad- dresses. to enable the internal fm synthesis engine, the ifm bit in the hardware configuration data, byte 8 (global configuration byte) must be set. this bit is also available in wss register x4. volume control for the internal fm synthesizer is supported through x6 and x7 in the wss ex- tended register space. the volume range is 0 db to -94.4 db with 000000 equal to 0 db. after ds213pp4 cs4237b 73
volume is applied to the pcm fm data, it is summed into the digital mixer which is then summed into the analog output mixer. for backwards compatibility with analog-mixed external fm devices, i18 and i19 in the wss logical device can be remapped to control the volume of internal fm. remapping is controlled through the fmrm bit in x4 register. when ifm = 1, and fmrm = 1, writes to i18 and i19 are remapped to x6 and x7 respectively. when remapping is enabled, the line analog input volume is controlled through x0/1. when fmrm = 0, internal fm volume is only control- led through x6/7. the synthesizer interface is compatible with the adlib and sound blaster standards. the typical adlib i/o address is synbase = 388h. standard adlib synthesizer i/o map address name type synbase+0 fm status read only synbase+0 fm address 0 write only synbase+1 fm data 0 write only synbase+2 fm address 1 write only synbase+3 fm data 1 read only external peripheral port an external peripheral port is provided for inter- facing devices external to the part. these may include the cs9233 wavetable synthesizer, cdrom interface, modem interface, and plug and play e 2 prom. the external peripheral port consists of the fol- lowing signals: 8-bit data bus, 2 or 3 address lines, read strobe, write strobe, and reset signal. external synthesizer interface this part contains an internal fm synthesis en- gine. for backwards compatibility the default is to use an external fm-type synthesizer chip such as the yamaha opl3ls, or the crystal semicon- ductor cs9233 wave-table synthesizer chip. this interface consists of: scs - chip select sint - synthesizer interrupt the other signals such as address bits, data strobes, data, and reset are provided by the ex- ternal peripheral port. the interface allows the host computer to access up to eight i/o mapped locations. when using an external fm synthe- sizer, scs will respond to the synbase decode addresses as well as the sbpro mapped fm syn- thesizer addresses. the pnp synthesizer alignment must be a multiple of 8. the polarity of sint is programmable via hard- ware configuration data, ihs in byte 7, or through ctrlbase+1. the default is active low (ihs = 0). since the typical fm interface only requires four i/o address and does not use an interrupt, the xa2 address and the sint pins are multifunc- tion pins that default to xctl0 and xctl1. to use xctl0/xa2 as an address pin, the hardware resource data must be changed. see the hard- ware configuration data section for more information. to use xctl1/ sint/ acdcs/ down as an interrupt for the synthesizer, vcen (in the hardware configuration data) must be zero, a pulldown resistor must be placed on the xiow pin. since xctl1 and sint are rarely used the pin has a third multiplexed func- tion, acdcs, which is described in the cdrom section below. the fourth multiplexed function is the hardware volume control pin down which is controlled through the vcen bit. see the volume control interface section for more details. note that acdcs takes precedence over xctl1/ sint. also down, when vcen is set, takes precedence over all other functions. ds213pp4 cs4237b 74
cdrom interface an ide cdrom controller interface is provided that supports enhanced as well as legacy ide cdrom drives. this interface includes two pro- grammable chip selects and on-chip hardware to map dma and interrupt signals to the isa bus. there are five pins that make up the cdrom interface which consist of: cdcs - chip select, combase address cdint - interrupt, comint cdrq - dma request, comdma cdack - dma acknowledge, comdma acdcs - alternate chip select, acdbase the four basic cdrom interface pins are multi- function pins that default to the upper address bits sa12 - sa15. to use the pins as a cdrom interface, a pulldown resistor must be placed on xior ( xior must be buffered if driving ttl logic). once the cdrom interface is selected, the cdrom dma pins are further multiplexed with the modem pins. therefore, a fifth logical device, typically a modem, can be used if the cdrom doesnt support dma. see the modem interface section for more details. the fifth cdrom pin acdcs is multiplexed with xctl1/ sint/ down. this chip select sup- ports the alternate cdrom chip select used for status in legacy ide drives. the volume control pin down has the highest precedence; there- fore, the vcen bit must be zero to use this pin for the cdrom interface. given that vcen is zero, if the base address for acdcs, which is acdbase, is programmed to a non-zero value, this pin converts to acdcs. acdbase, base ad- dress 1 in ld4, is programmed via pnp or via the slam method. once this pin is set to acdcs, the only way to revert to xctl1 or sint is to reset the part. the range of addresses that acdcs will respond to is programmable via the hardware configuration data, byte 5, from one to eight bytes. the default is 1 byte. in legacy ide cdrom drives, the alternate cdrom address plus 1, acdbase+1, is typi- cally shared with the floppy controller, which only drives data bit 7. therefore, a bit in the hardware configuration data keeps the sd7 pin from driving data bit 7 when that address is de- coded. this bit is labeled acdb7d and is located in the hardware configuration data, byte 7. when using acdcs, t he sint function should be selected and a pullup placed on this line, which will allow this pin to powerup inac- tive. if xctl1 is selected, it will powerup low; therefore, acdcs will be low until acdbase is programmed to a non-zero value. the default address space for the peripheral port is 4 i/o locations where xctl0/xa2 defaults to the control pin xctl0. to use xctl0/xa2 as the xa2 address pin, thereby increasing the ad- dress range of the peripheral port to 8 locations, the hardware resource data must be changed. see the hardware configuration data section. even though the default address space is only 4 loca- tions, the alignment for cdbase must be a division of 8. to make the cdrom interface more flexible, two global bits, located in the hardware con- figuration data section - byte 7, allow control over the polarity of the cdrom interrupt pin cdint, and whether the sd<7-0> pins drive the isa bus or not. the first bit is ihc which de- faults to 1 indicating that cdint is an active high interrupt. ihc is also controllable through ctrlbase+1. the second bit is sdd - sd<7:0> bus disable. when this bit is set, the part will not drive the isa data bus sd<7:0> pins, on reads from either cdbase or acdbase addresses. this bit allows external data buffers to be used for a cdrom that bypasses the xd<7:0> bus and connects directly to the isa bus. note that sdd affects any peripheral port device which in- cludes the external fm and modem interfaces. ds213pp4 cs4237b 75
modem interface the modem interface, logical device 5 (ld5) consist of: mcs - modem chip select mint - modem interrupt the other signals such as address bits, data strobes, data, and reset are provided by the ex- ternal peripheral port. the interface allows the host computer to access up to eight i/o mapped locations. the modem signals are multiplexed with both the upper isa address pins, and the cdrom dma pins. to enable the modem, first a pull- down resistor must be placed on xior which disables the upper isa address pins. second, the modem base address, combase, must be pro- grammed to a non-zero value which will convert the sa13/ cdack/ mcs pin to the modem chip select mcs, and the sa15/cdrq/mint pin to the modem interrupt pin mint. once these two pins switch to modem pins, they can only be changed by resetting the part. combase, logical device 5 base address 0, is programmed via pnp or the slam method. the polarity of mint is programmable via hardware configuration data, ihm in byte 7, or through ctrlbase+1. the default is active low (ihm = 0). dsp serial audio data port the wss codec includes a dsp serial audio in- terface for transferring digital audio data between the part and an external serial device such as a dsp processor. the dsp serial port pins are multiplexed with either the #2 joystick inputs of the game port interface or a portion of the xd peripheral bus. the selection is made via the sps bit located in control register c8, or the global config. byte in the hardware configura- tion data. if sps is 0, the joystick b pins convert to the dsp serial port when spe is set (mce must be 1 to change spe). if sps is 1, xd<4:1> convert to the dsp serial port when spe is set. in this case, sd<7:0> is disabled on reads of pe- ripheral port addresses (cdrom, modem, etc.) since xd<7:0> is no longer available. the dsp audio serial port is software enabled via the spe bit in the wss codec indirect regis- ter i16. the isa interface is fully active in this mode. while the serial port is enabled, audio data may still be read from the adcs over the isa bus, and the dacs will sum data from the sdin pin, the parallel isa bus data, and the in- ternal fm synthesizer engine. the serial port sample frequency is always 44.1 khz regardless of the isa bus sample frequency, and the data format is always twos complement 16-bit linear. fsync and sclk are always output from the part when the serial port is enabled. the serial port can be configured in one of four serial port formats, shown in figures 9-12. sf1 and sf0 in i16 select the particular format. mce in r0 must be set to change sf1/0. both left and right audio words are always 16 bit twos complement. when the mono audio format is selected, the right channel output is set to zero and the left channel input is summed to both dac channels. the first format - spf0, shown in figure 9, is called 64-bit enhanced. this format has 64 sclks per frame with a one bit period wide fsync that precedes the frame. the first 16 bits occupy the left word and the second 16 bits oc- cupy the right word. the last 32 bits contain four status bits and 28 zeros. this is the only mode that contains status information. the second serial format - spf1, shown in fig- ure 10, is called 64-bit mode. this format has 64 sclks per frame, with fsync high transitions at the start of the left data word and low transi- tions at the start of the right data word. both the left and right data words are followed by 16 ze- ros. ds213pp4 cs4237b 76
fsync sclk sdout 15 14 13 12 ... 16 bits left data 0 15 14 ... 0 16 bits right data 8 zeros sdin 15 14 13 12 ... 16 bits left data 0 15 14 ... 0 16 bits right data int = interrupt bit cen = capture enable pen = playback enable ovr = left overrange or right overrange int 7 zeros cen pen ovr 13 zeros 32 bits ... figure 9. 64-bit enhanced mode (sf1,0 = 00) fsync left data sclk sdout/ 15 14 13 0 ... 15 14 13 0 ... 15 right data 16 clocks 16 clocks 16 clocks 16 clocks sdin ... ... figure 10. 64-bit mode (sf1,0 = 01) sclk fsync left data sdout/ 15 14 13 0 ... 16 clocks 15 14 13 0 ... 16 clocks 15 right data 32 no-clock bit periods ... left data 14 ... ... sdin figure 11. 32-bit mode (sf1,0 = 10) ds213pp4 cs4237b 77
the third serial format - spf2, shown in fig- ure 11, is called 32-bit mode. this format has 32 sclks per frame and fsync is high for the left channel and low for the right channel. the absolute time is similar to the other two modes but sclk is stopped after the right channel is finished. sclk is held stopped until the start of the next frame (stopped for 32 bit period times). this mode is useful for dsps that do not want the interrupt overhead of the 32 unused bit peri- ods. as an example, if a dsp serial word length is 16 bits, then four interrupts will occur in spf0 and spf1 modes. in mode spf2 the dsp will only be interrupted twice. the fourth serial format - spf3, shown in fig- ure 12, is called adc/dac mode. this format has 64 sclks per frame, with fsync high transitions at the start of the left adc data word and low transitions at the start of the right adc data word. for serial data in, sdin, both the left and right 16-bit dac data word should be fol- lowed by zeros. for serial data out, sdout, both the left and right adc data words are fol- lowed by 16 bits of the dac data words. the dac data words are tapped off the data stream right before the data enters the codec dacs (af- ter all digital summing is done). having the adc and dac data on the sdout allows ex- ternal modem dsps to cancel the local audio source from the local microphone signal. cs9236 wavetable serial port a digital interface to the crystal cs9236 single- chip wavetable music synthesizer is provided that allows the cs9236 pcm audio data to be summed digitally into the output digital mixer. the wavetable serial port pins are multiplexed with the xd7-xd5 external bus pins; therefore, when this serial interface is enabled, any external peripheral (cdrom, modem, etc.) will need an external buffer to the isa bus. this serial port is enabled via the wten bit located in control register c8 or in the global configuration byte in the hardware configuration data. the hard- ware connections to the cs9236 are illustrated in figure 13. volume control for the serial port is supported through x16 and x17 in the wss extended reg- ister space. the volume range is +12 db to -82.5 db with 001000 equal to 0 db. after vol- ume is applied to the pcm data, it is summed into the digital mixer which is then summed into the analog output mixer. fsync left data sclk sdout 15 right data adc 16 clocks dac 16 clocks adc 16 clocks dac 16 clocks sdin ... ... 15 14 13 ... 0 15 14 13 ... 0 15 14 13 ... 0 15 14 13 ... 0 15 14 13 ... 0 15 14 13 ... 0 dac 16 clocks dac 16 clocks 15 figure 12. adc/dac mode (sf1,0 = 11) ds213pp4 cs4237b 78
for backwards compatibility with analog-mixed wavetable devices, i18 and i19 in the wss logi- cal device can be remapped to control the volume of the wavetable serial port. remapping is controlled through the wtrmd bit in x4 reg- ister. when wten = 1, and wtrmd = 0, writes to i18 and i19 are remapped to x16 and x17 respectively. when remapping is enabled, the line analog input volume is controlled through x0/1. when wtrmd = 1, the wavetable serial port volume is only controlled through x16/17. wss codec software description the wss codec must be in mode change en- able mode (mce=1) before any changes to the interface configuration register (i9) or the sam- ple frequency (lower four bits) in the fs & playback data format registers (i8) are allowed. the actual audio data formats, which are the up- per four bits of i8 for playback and i28 for capture, can be changed by setting mce (r0) or pmce/cmce (i16) high. the exceptions are cen and pen which can be changed "on-the- fly" via programmed i/o writes. all outstanding dma transfers must be completed before new values of cen or pen are recognized. calibration the wss codec has four different calibration modes. the selected calibration occurs whenever the mode change enable (mce, r0) bit goes form 1 to 0. the completion of calibration can be determined by polling the auto-calibrate in-progress bit in the error status and initialization register (aci, i11). this bit will be high while the calibration is in progress and low once completed. transfers enabled during calibration will not begin until the calibration cycle has completed. since the part always operates at 44.1 khz internally, all calibration times are based on 44.1 khz sample periods. the calibration procedure is as follows: 1) place the wss codec in mode change enable using the mce bit of the index ad- dress register (r0). 2) set the cal1,0 bits in the interface configura- tion register (i9). 3) return from mode change enable by reset- ting the mce bit of the index address register (r0). 4) wait until 80h not returned 5) wait until aci (i11) cleared to proceed no calibration (cal1,0 = 00) this is the fastest mode since no calibration is performed. this mode is useful for games which require the sample frequency be changed quickly. this mode is also useful when the codec is operating full-duplex and an adc data format change is desired. this is the only calibration mode that does not affect the dacs (i.e. mute the dacs). the no calibration mode takes zero sample periods. breset sdata lrclk mclk cs9236 mclk5i lrclk midi_in sout xtal3i pdn rst midout midin joystick connector midi out midi in 100 w 100k w 100k w figure 13. cs9236 wavetable serial port interface ds213pp4 cs4237b 79
converter calibration (cal1,0 = 01) this calibration mode calibrates the adcs and the dacs, but does not calibrate any of the ana- log mixing channels. this is the second longest calibration mode, taking 321 sample periods at 44.1 khz. because the analog mixer is not cali- brated in this mode, any signals fed through the mixer will be unaffected. the calibration se- quence is as follows: the dacs are muted the adcs are calibrated the dacs are calibrated the dacs are unmuted dac calibration (cal1,0 = 10) this calibration mode only clears the dacs (playback) interpolation filters leaving the adc unaffected. this is the second fastest calibration mode (no cal. is the fastest) taking 120 sample periods at 44.1 khz to complete. the calibration sequence is as follows: the dacs are muted the dac filters are cleared the dacs are unmuted full calibration (cal1, 0 = 11) this calibration mode calibrates all offsets, adcs, dacs, and analog mixers. full calibra- tion will automatically be initiated on power up or anytime the wss codec exits from a full power down state. this is the longest calibration mode and takes 450 sample periods at 44.1 khz to complete. the calibration sequence is as fol- lows: all outputs are muted (dacs and mixer) the mixer is calibrated the adcs are calibrated the dacs are calibrated all outputs are unmuted changing sampling rate the internal states of the wss codec are syn- chronized by the selected sampling frequency. the sample frequency can be set in one of three fashions. the standard wss codec method uses the fs & playback data format register (i8) to set the sample frequency. the changing of either the clock source or the clock frequency divide requires a special sequence for proper wss codec operation: 1) place the wss codec in mode change en- able using the mce bit of the index address register (r0). 2) during a single write cycle, change the clock frequency divide select (cfs) and/or clock 2 base select (c2sl) bits of the fs & playback data format register (i8) to the de- sired value. (the data format may also be changed.) 3) the wss codec resynchronizes its internal states to the new frequency. during this time the wss codec will be unable to respond. writes to the wss codec will not be recog- nized and reads will always return the value 80 hex. 4) the host now polls the wss codecs index address register (r0) until the value 80 hex is no longer returned. on slow processor sys- tems, 80h may occur to fast; therefore, it may never be seen by software. 5) once the wss codec is no longer responding to reads with a value of 80 hex, normal op- eration can resume and the wss codec can be removed from mce. a second method of changing the sample fre- quency is to disable the sample frequency bits in i8 (lower four bits) by setting sre in i22. when this bit is set, osm1 and osm0 in i10, along ds213pp4 cs4237b 80
with the rest of the bits in i22, are used to set the sample frequency. once enabled, these bits can be changed without doing an mce cycle. the third method supports independent sample frequencies (fs) for capture and playback. the independent sample frequency mode is enabled by setting ifse in x11. once enabled, the other two methods for setting fs (i8, i10, and i22) are disabled. the capture (adc) fs is set in x12 and the playback (dac) fs is set in x13. changing audio data formats in mode 1, mce must be used to select the audio data format in i8. since mce causes a calibration cycle, it is not ideal for full-duplex operation. in mode 2 and 3, individual mode change enable bits for capture and playback are provided in register i16. mce (r0) must still be used to select the sample frequency, but pmce (playback) and cmce (capture) allow changing the respective data formats without causing a calibration to occur. setting pmce (i16) clears the playback fifo and allows the upper four bits of i8 to be changed. setting cmce (i16) clears the capture fifo and allows the upper four bits of i28 to be changed. audio data formats in mode 1 operation, all data formats of the wss codec are in "little endian" format. this format defines the byte ordering of a multibyte word as having the least significant byte occupy- ing the lowest memory address. likewise, the most significant byte of a little endian word oc- cupies the highest memory address. the sample frequency is always selected in the fs & playback data format register (i8). in mode 1 the same register, i8, determines the audio data format for both playback and capture; however, in mode 2 and 3, i8 only selects the playback data format and the capture data format is independently selectable in the capture data format register (i28). the wss codec always orders the left channel data before the right channel. note that these definitions apply regardless of the specific for- mat of the data. for example, 8-bit linear data streams look exactly like 8-bit companded data streams. also, the left sample always comes first in the data stream regardless of whether the sam- ple is 16-bit or 8-bit in size. there are four data formats supported by the wss codec during mode 1 operation: 16-bit signed (little endian), 8-bit unsigned, 8-bit com- panded m -law, and 8-bit companded a-law. see figures 14-17. additional data formats are supported in mode 2 and 3: 4-bit adpcm, and 16-bit signed big endian. see figures 18 through 21. with the ad- dition of the big endian and adpcm audio data formats, the wss codec is compliant with the ima recommendations for digital audio data for- mats (and sample frequencies). 16-bit signed the 16-bit signed format (also called 16-bit 2s complement) is the standard method of repre- senting 16-bit digital audio. this format gives 96 db theoretical dynamic range and is the standard for compact disk audio players. this format uses the value -32768 (8000h) to repre- sent maximum negative analog amplitude, 0 for center scale, and 32767 (7fffh) to represent maximum positive analog amplitude. 8-bit unsigned the 8-bit unsigned format is commonly used in the personal computer industry. this format de- livers a theoretical dynamic range of 48 db. this format uses the value 0 (00h) to represent maxi- mum negative analog amplitude, 128 for center scale, and 255 (ffh) to represent maximum positive analog amplitude. the 16-bit signed and 8-bit unsigned transfer functions are shown in figure 22. ds213pp4 cs4237b 81
sample 6 sample 5 sample 4 sample 3 sample 2 sample 1 mono mono mono 32-bit word time 0 7 8 15 16 23 24 31 mono figure 14. 8-bit mono, unsigned audio data sample 3 sample 3 sample 2 sample 2 sample 1 sample 1 left right left 32-bit word time 0 7 8 15 16 23 24 31 right figure 15. 8-bit stereo, unsigned audio data sample 6 sample 5 sample 4 sample 3 sample 2 sample 1 mono mono 32-bit word time 0 15 16 31 23 24 7 8 figure 16. 16-bit mono, signed little endian audio data sample 3 sample 3 sample 2 sample 2 sample 1 sample 1 left right 32-bit word time 0 15 16 31 23 24 7 8 figure 17. 16-bit stereo, signed little endian audio data ds213pp4 cs4237b 82
sample 6 sample 5 sample 4 sample 3 sample 2 sample 1 mono 32-bit word time 0 3 4 7 8 15 sample 8 sample 7 16 19 20 23 24 27 28 31 mono mono mono mono mono mono mono 11 12 figure 18. 4-bit mono, adpcm audio data sample 3 sample 3 sample 2 sample 2 sample 1 sample 1 32-bit word time 0 3 4 7 8 11 12 15 sample 4 sample 4 16 19 20 23 24 27 28 31 right left right left left right left right figure 19. 4-bit stereo, adpcm audio data sample 3 sample 3 sample 2 sample 2 sample 1 sample 1 mono hi mono lo 32-bit word time 8 15 0 7 sample 4 sample 4 mono hi mono lo 24 31 16 23 figure 20. 16-bit mono, signed big endian audio data sample 2 sample 2 sample 1 sample 1 sample 1 sample 1 left hi left lo 32-bit word time 8 15 0 7 sample 2 sample 2 right hi right lo 24 31 16 23 figure 21. 16-bit stereo, signed big endian audio data ds213pp4 cs4237b 83
8-bit companded the 8-bit companded formats (a-law and m - law) come from the telephone industry. m -law is the standard for the united states/japan while a-law is used in europe. companded audio al- lows either 64 db or 72 db of dynamic range using only 8-bits per sample. this is accom- plished using a non-linear companding transfer function which assigns more digital codes to lower amplitude analog signals with the sacrifice of precision on higher amplitude signals. the m - law and a-law formats of the wss codec conform to the ccitt g.711 specifications. fig- ure 23 illustrates the transfer function for both a- and m -law. please refer to the standards men- tioned above for an exact definition. adpcm compression/decompression in mode 2 and 3, the wss codec also con- tains adaptive differential pulse code modulation (adpcm) for improved perform- ance and compression ratios over m -law or a-law. the adpcm format is compliant with the ima standard and provides a 4-to-1 com- pression ratio (i.e. 4 bits are saved for each 16-bit sample captured). for more information on the specifics of the format, contact the ima at (410) 626-1380. figures 18 and 19 illustrate the adpcm data flow. the adpcm format is unique with respect to the fifo depth and the dma base register value. the adpcm format fills the fifos com- pletely (64 bytes); therefore, the fifos hold 64 stereo samples and 128 mono samples. when samples are being transferred using dma, the dma request stays active for four bytes, similar to the 16-bit stereo data mode. in pio mode, the status register (r2) indicates which of the four bytes is being transferred. when cen is 0 (capture disabled), the adpcm blocks accumulator and step size are cleared. when cen is enabled, the adpcm block will start converting. care should be taken to insure that the "overrun" condition never occurs, other- wise the data may not be constructed properly upon playback. if pausing the capture sequence is desired, the adpcm capture freeze bit (acf, i23) should be set. when this bit is set, the adpcm algorithm will continue to operate until a complete word (4 bytes) is written to the fifo. then the adpcms block accumulator and step size will be frozen. the software must continue figure 22. linear transfer functions 0 +fs -fs digital code analog value a-law: 2ah 15h 95h aah 7fh/ffh 55h/d5h 00h 3fh bfh 80h u-law: figure 23. companded transfer functions ds213pp4 cs4237b 84
reading until the fifo is empty, at which time the requests will stop. when acf is cleared, the adpcm adaptation will continue. when pen is cleared (playback disabled), the adpcm blocks accumulator and step size are cleared. when pen is set, the adpcm block will start converting. when pausing the playback stream is desired, audio data should not be sent to the codec which will cause a data underrun. this can be accomplished by disabling the dma controller or not sending data in pio mode. the underrun will be detected by the wss codec and the adaptation will freeze. when data is sent to the codec, adaptation will resume. it is critical that all playback adpcm samples are sent to the codec, since dropped samples will cause errors in adaptation. whereas toggling pen resets the accumulator and step size, the apar bit (i17) only resets the accumulator without affecting the step size. dma registers the dma registers allow easy integration of this part into isa systems. peculiarities of the isa dma controller require an external count mechanism to notify the host cpu of a full dma buffer via interrupt. the programmable dma base registers provide this service. the act of writing a value to the upper base register causes both base registers to load the current count register. dma transfers are en- abled by setting the pen/cen bit while ppio/cpio is clear. (ppio/cpio can only be changed while the mce bit is set.) once trans- fers are enabled, each sample that is transferred by a dma cycle will decrement the current count register (with the exception of the adpcm format) until zero is reached. the next sample after zero generates an interrupt and re- loads the current count registers with the values in the base registers. for all data formats except adpcm, the dma base registers must be loaded with the number of samples, minus one, to be transferred between "dma interrupts". stereo data contains twice as many samples as mono data; however, 8-bit data and 16-bit data contain the same number of sam- ples. symbolically: dma base register 16 = n s - 1 where n s is the number of samples transferred between interrupts and the "dma base regis- ter 16 " consists of the concatenation of the upper and lower dma base registers. for the adpcm data format, the contents of the dma base registers is calculated differently from any other data format. the base registers must be loaded with the number of bytes to be transferred between "dma interrupts", divided by four, minus one. the same equation is used whether the data format is stereo or mono adpcm. symbolically: dma base register 16 = n b /4 - 1 where n b is the number of bytes transferred between interrupts and the "dma base regis- ter 16 " consists of the concatenation of the upper and lower dma base registers. playback dma registers the playback dma registers (i14/15) are used for sending playback data to the dacs in mode 2 and 3. in mode 1, these registers (i14/15) are used for both playback and capture; therefore, full-duplex dma operation is not pos- sible. when the playback current count register rolls under, the playback interrupt bit, pi, (i24) is set causing the int bit (r2) to be set. the interrupt is cleared by a write of any value to the status register (r2), or writing a "0" to the playback interrupt bit, pi (i24). ds213pp4 cs4237b 85
capture dma registers the capture dma base registers (i30/31) pro- vide a second pair of base registers that allow full-duplex dma operation. with full-duplex op- eration capture and playback can occur simultaneously. these registers are provided in mode 2 and 3 only. when the capture current count register rolls under, the capture interrupt bit, ci, (i24) is set causing the int bit (r2) to be set. the interrupt is cleared by a write of any value to the status register (r2), or writing a "0" to the capture in- terrupt bit, ci (i24). digital loopback digital loopback is enabled via the lbe bit in the loopback control register (i13). this loop- back routes the digital data from the adcs to the dacs. there are two methods of control- ling this loopback. the first method does not allow separate control over the attenuation level of the left and right channels. changes to the attenuation bits of register i13 will simultane- ously affect both the left and the right channels. the other method of controlling loopback, is to set the slbe bit in register x10. this separates the attenuation levels of the left and right chan- nels. with slbe enabled, the attenuation bits of register i13 only control the left channel, and the attenuation bits of register x10 control the right channel. the lbe bit in register i13 still en- ables, or disables digital loopback for both channels. loopback is then summed into the digital mixer. the digital loopback is illustrated in figure 4. since the wss codec allows selec- tion of different data formats between capture and playback, if the capture channel is set to mono and the playback channel set to stereo, the mono input (mic) data will be mixed into both channels of the output mixer. if the sum of the digital mixer inputs is greater than full scale, wss codec will send the appro- priate full scale value to the dacs (clipping). timer registers the timer registers are provided for synchroni- zation, watch dog and other functions where a high resolution time reference is required. this counter is 16 bits and the exact time base, listed in the register description, is determined by the clock base frequency selected. the timer register is set by loading the high and low registers to the appropriate values and set- ting the timer enable bit, te, in the alternate feature enable register (i16). this value will be loaded into an internal current count register and will decrement at approximately a 10 m sec rate. when the value of the current count regis- ter reaches zero, an interrupt will be posted to the host and the timer interrupt bit, ti, is set in the alternate feature status register (i24). on the next timer clock the value of the timer regis- ters will be loaded into the internal current count register and the process will begin again. the interrupt is cleared by any write to the status register (r2) or by writing a "0" to the timer interrupt bit, ti, in the alternate feature status register (i24). wss codec interrupt the int bit of the status register (r2) always reflects the status of the wss codecs internal interrupt state. a roll-over from any current count register (dma playback, dma capture, or timer) sets the int bit. this bit remains set until cleared by a write of any value to status regis- ter (r2), or by clearing the appropriate bit or bits (pi, ci, ti) in the alternate feature status regis- ter (i24). ds213pp4 cs4237b 86
the interrupt enable (ien) bit in the pin control register (i10) determines whether the interrupt assigned to the wss codec responds to the in- terrupt event. when the ien bit is low, the interrupt is masked and the irq pin assigned to the wss codec is held low. however, the int bit in the status register (r2) always responds to the counter. error conditions data overrun or underrun could occur if data is not supplied to or read from the wss codec in an appropriate amount of time. the amount of time for such data transfers depends on the fre- quency selected within the wss codec. should an overrun condition occur during data capture, the last whole sample (before the over- run condition) will be read by the dma interface. a sample will not be overwritten while the dma interface is in the process of transfer- ring the sample. should an underrun condition occur in a play- back case the last valid sample will be output (assuming dacz = 0) to the digital mixer. this will mask short duration error conditions. when the next complete sample arrives from the host computer the data stream will resume on the next sample clock. the overrun and underrun error bits in the alter- nate feature status register, i24, are cleared by first clearing the condition that caused the over- run or underrun error, followed by writing the particular bit to a zero. as an example, to clear the playback underrun bit pu, first a sample must be sent to the wss codec, and then the pu bit must be written to a zero. digital hardware description the best example of hardware connection for the different sections of this part such as joystick connector, isa bus, and peripheral port connec- tions is the reference design data sheet. the reference design data sheet contains all the schematics, layout plots and a bill of materials; thereby providing a complete example. bus interface the isa bus interface is capable of driving a 24ma data bus load and therefore does not re- quire any external data bus buffering. see the reference design data sheet for a typical con- nection diagram. volume control interface three hardware master volume control pins are supported: volume up, volume down, and mute. hardware volume control is enabled by setting the vcen bit in the hardware configuration data, byte 7 (misc. config. byte). once vcen is set, the scs/ up pin converts to the volume up function and the xtal1/ sint/ acdcs/ down pin converts to the volume down function. the volume control pins affect the master volume control output after the analog output mixer. the up and down pins, when low, increment and decrement the master volume. these two pins would use spst momentary switches. the mute pin supports three options: push-on/push- off, momentary (similar to the up/down functions), and non-existent where pressing up and down simultaneously mutes the output vol- ume. as shown in figure 24, the three pins require external pullups and are active low. the circuit also contains an optional rc for emi and esd protection. the volume control range is +12 to -36 db in 2 db steps. pressing the up button, increments the volume. pressing the down button, decre- ments the volume. holding either of these buttons in the low state causes the volume to to continue changing. the mute function is supported using three for- mats. these formats are selected using the vcf1 and vcf0 bits in the hardware configuration data, global config. byte. ds213pp4 cs4237b 87
in the first format, where vcf1,0 = 00, the mute function is a toggle or push-on/push-off style. when the mute pin is low, the master out vol- ume is muted. pressing the up or down buttons have no effect while the mute switch is on. in the second format, where vcf1,0 = 01, the mute function is a momentary switch (similar to up and down). when mute goes low the mas- ter out volume mutes if it was un-muted and vise-versa (the mute button alternates between mute and un-mute). if the master volume is muted and up or down is pressed, the volume automatically un-mutes. in the third format, where vcf1,0 = 10, the mute pin is not used. this is a two-button for- mat where pressing up and down simultaneously mutes the master volume. if the master volume is muted and up or down is individually pressed, the volume automatically un-mutes. the three formats listed above as illustrated in figure 25. a fourth format for mute exists, where vcf1,0 = 11, which is backwards compatible with the cs4236. this mode is similar to the two button mode, except the mute pin is used as the up function and the up pin is not used. crystal / clock two pins have been allocated to allow the inter- facing of a crystal oscillator: xtali and xtalo. the crystal should be designed as fun- damental mode, parallel resonant, with a load capacitor of between 10 and 20 pf. the capaci- tors connected to each of the crystal pins should be twice the load capacitance specified to the crystal manufacturer. an external cmos clock may be connected to the crystal input xtali in lieu of the crystal. when using an external cmos clock, the xtalo pin must be left floating with no trace or external connection of any kind. general purpose output pins two general purpose outputs are provided to en- able control of external circuitry (i.e. mute function). xctl1 and xctl0 in the wss codec register i10 are output directly to the ap- propriate pin when enabled. pin xctl0/xa2 becomes an output for xctl0 whenever the resource data for the cdrom or synthesizer specifies a logical device address 100 pf vdf 10 k w 10 k w 10 k w up down mute up gnd mute down 100 w 100 pf 100 pf 100 w 100 w figure 24. volume control circuit up gnd mute down vcf1,0 = 00 up gnd mute down vcf1,0 = 01 up gnd mute down vcf1,0 = 10 figure 25. volume control formats ds213pp4 cs4237b 88
range that is four bytes. if the address range is specified to be eight bytes, then xa2 becomes an output for sa2 from the isa bus. pin xctl1/ sint/ acdcs/ down is initially controlled by the vcen bit in the hardware configuration data. if vcen is zero, this pin be- comes an output for xctl1 when the state of the xiow pin is sampled high during a high to low transition of the resdrv pin. this pin also becomes an output for acdcs if acdbase is programmed to a non-zero value. if xiow is sampled low and acdbase is never programmed to a non-zero value, sint becomes an input for the external synthesizer interrupt. xiow has an internal pullup resistor. acdcs takes prece- dence over the other two functions. the first time acdbase is programmed to a non-zero value, the pin converts to acdcs. the only way to convert back to xtal1 or sint is to reset the part. vcen has the highest precedence and will cause this pin to convert to the down function whenever vcen is set. reset and power down a resdrv pin places the part into maximum power conservation mode. when resdrv goes high, the pnp registers are reset - all logical de- vices are disabled, all analog outputs are muted, and the voltage reference then slowly decays to ground. when resdrv is brought low, an in- itialization procedure begins which causes a full calibration cycle to occur. when initialization is completed, the registers will contain their reset value and the part will be isolated from the bus. resdrv is required whenever the part is pow- ered up. the initialization time varies based on whether an e 2 prom is present or not and the size of the data in the e 2 prom. after resdrv goes low, the cs4236 should not be written to for approximately one and one half second to guarantee that the part is ready to respond to commands. the exact timing is specified in the timing section in the front of this data sheet. software low-power states are available through bits in the control logical device register space. this part supports the same power down bits contained in the cs4232; however, new power down modes are provided in ctrlbase+2 that allow for a more efficient power management routine. this register allows individual blocks within the part to be powered down. see the control interface section for more infor- mation. multiplexed pin configuration on the high to low transition of the resdrv pin, the part samples the state of the xior and xiow pins. both of these pins have internal 100k w pullups to +5v. if either of these pins is pulled low externally, they must be buffered be- fore connecting to a ttl input (as in a cdrom port) since ttl cannot be pulled low. the state of xior at the time resdrv is brought low determines the function of the cdrom interface pins. if xior is sampled high, then cdcs, cdack, cdint, cdrq are used to input sa12, sa13, sa14, sa15 respec- tively. if xior is sampled low (external pulldown) then cdcs, cdack, cdint, cdrq become the standard cdrom interface pins. since many cdrom drives do not use dma, the cdrq and cdack pins are further multi- plexed with mcs and mint respectively. mcs is the modem chip select that responds to com- base addresses, and mint is the modem interrupt input. these two pins comprise logical device 5. the first time combase is pro- grammed to non-zero (assuming xior wa s sampled low), cdack/ mcs and cdrq/mint switch to mcs and mint respectively. once this switch occurs, the only way to revert to the cdrom dma pins is to reset the part or re- move power. the xctl1/ sint/ acdcs/ down pin state is first determined by vcen. if vcen is set this pin is forced to the down volume control pin. ds213pp4 cs4237b 89
if vcen is zero, then if acdbase is ever pro- grammed to a non-zero value, this pin converts to the acdcs pin and keeps this function until the part is reset (or vcen is set to one). if acdbase is never programmed non-zero, then the state of xiow at the time resdrv is brought low determines whether the pin is xctl1 or sint. if xiow is sampled low (ex- ternal pulldown) then xctl1/ sint/ acdcs/ down functions as an input for the synthesizer interrupt. if xiow is sampled high (pin left unconnected) then xctl1/ sint/ acdcs/ down becomes an output for xctl1. this part contains another multiplexed pin, scs/ up. this pin provides the fm synthesizer chip select or the hardware volume control "vol- ume up" feature. since an internal fm synthesizer exists, this pin would normally be used for the volume control feature. setting vcen forces this pin to the up volume control function. when vcen is clear, this pin is the scs chip select function. analog hardware description the analog hardware consist of an mpc level 2-compatible mixer (four stereo mix sources), three line-level stereo inputs, a stereo microphone input, a mono input, a mono output, and a stereo line output. this section describes the analog hardware needed to interface with these pins. line-level inputs plus mpc mixer the analog inputs consist of four stereo analog inputs, and one mono input. as shown in fig- ure 4, the input to the adcs comes from the input mixer that selects any combination of the following: line, aux1, aux2, mic, the dac output, and the output from the analog output mixer. unused analog inputs should be con- nected together and then connected through a capacitor to analog ground. the analog input interface is designed to accom- modate four stereo inputs and one mono input. four of these sources are mixed to the adc. these inputs are: a stereo line-level input (line), a stereo microphone input (mic), a ste- reo cd-rom input (aux2), and a stereo auxiliary line-level input (aux1). the line and aux1 inputs have two paths to the input mixer. one path is direct with no volume con- trol. the other path goes through an inverting amplifier, which enables volume control. care should be taken to select only one of these dual paths, because the inverting path will cancel the signal of the non-inverting path at the input mixer. the line, mic, aux1, and aux2 in- puts have paths after their volume controls, to the output mixer. the output mixer has the addi- tional input of a mono input channel. all audio inputs should be capacitively coupled. to obtain sound blaster mixer compatibility, the mapping of external devices to analog inputs is important. an external fm or wavetable synthe- sizer analog output must be connected to the line input. the internal fms volume control, when enabled, maps to the line analog mixer registers. the cdrom analog outputs must be connected to the aux2 inputs, and the external line inputs must be connected to the aux1 ana- log inputs. since some analog inputs can be as large as 2 v rms , the circuit shown in figure 26 can be used to attenuate the analog input to 1 v rms which is the maximum voltage allowed for the line-level inputs. 6.8 k w 6.8 k w 1.0 m f 1.0 m f r l 6.8 k w 6.8 k w figure 26. line inputs ds213pp4 cs4237b 90
the aux2 line-level inputs have an extra pin, cmaux2, which provides a pseudo-differential input for both laux2 and raux2. this pin takes the common-mode noise out of the aux2 inputs when connected to the ground coming from the aux2 analog source. connecting the aux2 pins as shown in figure 27 provides extra noise attenuation coming from the cdrom drive, thereby producing a higher quality signal. since the better the resistors match, the better the common-mode attenuation, one percent resistors are recommended. if cmaux2 is not used, it should be connected through an ac cap to ana- log ground. microphone level inputs the microphone level inputs, lmic and rmic, include a selectable -22.5 db to +22.5 db gain stage for interfacing to an external microphone. an additional 20 db gain block is available in the path to the output mixer. the 20 db gain block can be switched off to provide another ste- reo line-level input. figure 28 illustrates a single-ended microphone input buffer circuit that will support lower gain mics. if a mono micro- phone is all that is desired, the rmic input should be connected to the output of the mono op amp, used for lmic, through its own ac coupling capacitor. the circuit in figure 28 sup- ports dynamic mics and phantom-powered mics that use the right channel of the jack for power. mono input the mono input, min, is useful for mixing the output of the "beeper" (timer chip), provided in all pcs, with the rest of the audio signals. the attenuation control allows 16 levels in -3db steps. in addition, a mute control is provided. the attenuator is a single channel block with the resulting signal sent to the output mixer where it is mixed with the left and right outputs. fig- ure 29 illustrates a typical input circuit for the mono in. if min is driven from a cmos gate, the 4.7k w should be tied to agnd instead of va+. although this input is described for a low- quality beeper, the input is of the same high-quality as all other analog inputs and may be used for other purposes. at power-up, the min line is connected directly to the mout pin (with 9 db of attenuation) allowing the initial beeps, heard when the computer is initializing, to pass through. 6.8 k w 6.8 k w 1.0 m f 1.0 m f raux2 laux2 6.8 k w 6.8 k w 3.4 k w cmaux2 1.0 m f 3.4 k w (all resistors 1%) figure 27. differential cdrom in 0.1 m f 2.7 nf npo 10 m f + 600 w 4.7 k w 47 k w mc33078 or mc33178 0.33 m f vref lmic 1 m f + rmic 0.33 m f x7r 2 k w 47 k w figure 28. left or mono microphone input 2.7 nf 47 k w 4.7 k w 0.1 m f min 1 +5va (low noise) or agnd - if cmos source figure 29. mono input ds213pp4 cs4237b 91
line level outputs the analog output section provides a stereo line- level output. the other output types (headphone and speaker) can be implemented with external circuitry. lout and rout outputs should be capacitively coupled to external circuitry. both lout and rout need 1000 pf npo capacitors between the pin and agnd. mono output with mute control the mono output, mout, is a sum of the left and right output channels, attenuated by 6db to prevent clipping at full scale. the mono out channel can be used to drive the pc-internal mono speaker using an appropriate drive circuit. this approach allows the traditional pc-sounds to be integrated with the rest of the audio sys- tem. figure 30 illustrates a typical speaker driver circuit. the mute control is independent of the line outputs allowing the mono channel to mute the speaker without muting the line outputs. the power-up default has min connected to mout providing a pass-through for the beeps heard at power-up. miscellaneous analog signals the lfilt and rfilt pins must have a 1000 pf npo capacitor to analog ground. these capaci- tors, along with an internal resistor, provide a single-pole low-pass filter used at the inputs to the adcs. by placing these filters at the input to the adcs, low-pass filters at each analog input pin are avoided. the refflt pin is used to lower the noise of the internal voltage reference. a 1 m f (must not be greater than 1 m f) and 0.1 m f capacitor to ana- log ground should be connected with a short wide trace to this pin. no other connection should be made, as any coupling onto this pin will degrade the analog performance of the codec. likewise, digital signals should be kept away from refflt for similar reasons. the vref pin is typically 2.2 v and provides a common mode signal for single-supply external circuits. vref only supports light dc loads and should be buffered if ac loading is needed. for typical use, a 0.1 m f in parallel with a 10 m f ca- pacitor should be connected to vref. grounding and layout figure 31 is a suggested layout for motherboard designs and figure 32 is a suggested layout for add-inn cards. for optimum noise performance, the device should be located across a split ana- log/digital ground plane. the digital ground plane should extend across the isa bus pins as well as the internal digital interface pins. dgnd1 is ground for the data bus and should be electrically connected to the digital ground plane which will minimize the effects of the bus 1 m f + 1 2 7 3 8 5 6 4 16 k w 470 pf 0.1 m f ferrite bead 10 k w 0.22 m f mout +5v resdrv mc34119 or lm4861 figure 30. mono output ds213pp4 cs4237b 92
interface due to transient currents during bus switching. sgnd1-4 are the substrate grounds and should also be connected to the digital ground plane to minimize coupling into the ana- log section. figure 33 shows the recommended positioning of the decoupling capacitors. the ca- pacitors must be on the same layer as, and close to, the part. the vias shown go through to the ground and power plane layers. vias, power sup- ply traces, and refflt traces should be as large as possible to minimize the impedance. power supplies the power supply providing analog power should be as clean as possible to minimize cou- pling into the analog section and degrading analog performance. the vd1 is isolated from the rest of the power supply pins and provide digital power for the asynchronous parallel isa bus (except for drqa). the vd1 pin can be connected directly to the system digital power supply. vd1 can also be connected to a 3.3v supply providing a 3.3v isa interface. when connected to a 3.3v supply, all isa bus input pins (sa15-0, sd7-0, dacks, etc.) must be at 3.3v levels (not 5v), with the exception of the drqa pin. drqa is internally connected to the vdf supplies and remains a 5 volt pin even when the isa bus is run at 3.3 volts. when the isa bus is powered from 3.3 volts, drqa can be be used through a level translator, or drqa can remain used. if drqa is not used, all references to this pin should be removed in the pnp resource data. even though the isa bus is at 3.3v, the peripheral port is still at a 5v potential including xd7-0 and all chip select and address pins. vdf1 through vdf4 provide power to internal digital sections of the codec and should be qui- eter than vd1. this can be achieved by using a 1 digital ground analog ground crystal part power connector digital ground noise di g i t a l g r o u n d n o ise d i g i t a l g r o u n d n o i s e figure 31. suggested motherboard layout ds213pp4 cs4237b 93
cd-rom speaker in speaker out crystal part digital ground analog ground 1 figure 32. suggested add-in card layout pin 1 xd7 pin 17 vdf1 pin 54 vdf4 pin 66 sgnd2 pin 71 test pin 45 vd1 pin 81 va + pin 18 sgnd1 pin 53 sgnd4 pin 65 vdf2 pin 46 dgnd1 pin 80 agnd pin 79 refflt analog digital pin 98 vdf3 pin 97 sgnd3 1 m f .1 m f .1 m f .1 m f .1 m f .1 m f .1 m f .1 m f = vias through to power/ground plane figure 33. recommended decoupling capacitor positions ds213pp4 cs4237b 94
ferrite bead to the vd1 supply as shown in the reference design data sheet. these pins must be connected to a 5v supply. va provides power to the sensitive analog sec- tions of the chip and should have a clean, regulated supply to minimize power supply cou- pled noise in the analog inputs and outputs. adc/dac filter response plots figures 34 through 39 show the overall fre- quency response, passband ripple, and transition band for the adcs and dacs. figure 40 shows the dacs deviation from linear phase. since the filter response scales based on sample frequency selected, all frequency response plots x-axis are shown from 0 to 1, where 1 is equivalent to fs. therefore, for any given sample frequency, mul- tiply the x-axis values by the sample frequency selected to get the actual frequency. 10 0 - 10 - 20 - 30 - 40 - 50 - 60 - 70 - 80 - 90 - 100 0 . 00 . 10 . 20 . 30 . 40 . 50 . 60 . 70 .8 0 . 91 . 0 input frequency ( x fs) magnitude (db) figure 34. adc filter response 0 . 2 0. 1 0 . 0 -0. 1 - 0 . 2 - 0 . 3 - 0 . 4 - 0 . 5 - 0 . 6 - 0 . 7 - 0 . 8 0 . 00 0 . 05 0 . 10 0 . 15 0 . 20 0 . 25 0 . 30 0 .3 50 . 40 0 . 45 0 . 50 input frequency ( x fs) magnitude (db) figure 35. adc passband ripple 0 - 1 0 - 2 0 - 3 0 - 4 0 - 5 0 - 6 0 - 7 0 - 8 0 - 9 0 - 10 0 0 . 40 0 . 45 0 . 50 0 . 55 0 . 60 0 . 65 0 . 70 input frequency ( x fs) magnitude (db) figure 36. adc transition band ds213pp4 cs4237b 95
10 0 - 10 - 20 - 30 - 40 - 50 - 60 - 70 - 80 - 90 - 100 0 . 00 . 10 . 20 . 30 . 4 0. 50 . 60 . 70 . 80 . 91 . 0 input frequency ( x fs) magnitude (db) figure 37. dac filter response 0 . 2 0 . 1 0 . 0 - 0 . 1 - 0 . 2 - 0 . 3 - 0 . 4 - 0 . 5 - 0 . 6 - 0 . 7 - 0 . 8 0 . 00 0 . 05 0 . 10 0 . 15 0 . 2 0 0 . 25 0 .3 00 . 35 0 .4 00 . 45 0 . 50 input frequency ( x fs) magnitude (db) figure 38. dac passband ripple 0 - 10 - 20 - 30 - 40 - 50 - 60 - 70 - 80 - 90 - 100 0 . 40 0 . 45 0 . 50 0 . 55 0 . 60 0 . 65 0 . 70 input frequency ( x fs) magnitude (db) figure 39. dac transition band 2 . 0 1 . 5 1 . 0 0 . 5 0 . 0 - 0 . 5 - 1 . 0 - 1 . 5 - 2 . 0 0 . 00 0 . 05 0 . 10 0 . 1 5 0 . 20 0 . 2 5 0 . 30 0 .3 50 . 40 0 . 45 0 . 50 input frequency ( x fs) d phase (degrees) figure 40. deviation from linear phase ds213pp4 cs4237b 96
76 100 75 50 1 25 100-pin tqfp (top view) 26 51 s a 1 5* / c d r q / m i n t x t a l i c m a u x 2 x t a l o m u t e 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 v d f 3 s g n d 3 midin midout dacka (dack0*) dackb (dack1*) dackc (dack3*) drqa (drq0*) drqb (drq1*) drqc (drq3*) (int5*) irqa (int7*) irqb (int9*) irqc (int11*) irqd (int12*) irqe (int15*) irqf i o c h r d y iow a e n s d 1 s d 2 s d 3 d g n d 1 v d 1 s d 4 s d 5 s d 6 s d 7 sa11 s a 1 0 s a 9 s a 8 s a 7 s a 6 s a 5 s a 4 s a 3 s a 2 s a 1 s a 0 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 jbcx*/sdout xd7/sdata jacx xd5/mclk sgnd2 vdf2 jbcy*/sdin jacy jbb2*/sclk jab2 xd6/lrclk xd1sclk sda/xd0 vdf4 sgnd4 scs/up xior xiow xctl0*/xa2 xa1 scl/xa0 breset xctl1*/sint/acdcs/down 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 jbb1*/fsync jab1 s a 1 3 * / c d a c k / m c s s a 1 2 * / c d c s test r e s d r v m o u t m i n l a u x 2 lout r l i n e l l i n e r o u t r a u x 2 v a a g n d r e f f l t v r e f r f i l t laux1 l m i c r m i c raux1 l f i l t s a 1 4 * / c d i n t 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 77 i o r s d 0 xd2/sdin vdf1 sgnd1 xd4/fsync xd3/sdout * defaults - see individual pin descriptions for more details pin descriptions cs4237b ds213pp4 cs4237b 97
isa bus interface pins sa<11:0> - system address bus, inputs these signals are decoded during i/o cycles to determine access to the various functional blocks within the part as defined by the configuration data written during a plug and play configuration sequence. sa<15:12> - upper system address bus, inputs these signals are multi-function pins, shared with the cdrom and modem interface, that default to the upper address bits sa12 through sa15. these pins are generally used for motherboard designs that want to eliminate address decode aliasing. using these pins as upper address bits forces the part to only accept valid address decodes when a12-a15 = 0. if these pins are not used for address decodes (or for cdrom support), they should be tied to sgnd. sd<7:0> - system data bus, bi-directional, 24ma drive these signals are used to transfer data to and from the part and associated peripheral devices. reads from peripheral devices can be disabled (the part does not drive the sd<7:0> pins) by setting the sdd bit in the hardware configuration data. reads from peripheral devices are automatically disabled whenever the xd pins are used as serial port pins (sps/spe or wten set to one). aen - address enable, input this signal indicates whether the current bus cycle is an i/o cycle or a dma cycle. this signal is low during an i/o cycle and high during a dma cycle. ior - read command strobe, input this active low signal defines a read cycle to the part. the cycle may be a register read or a read from the part?s dma registers. iow - write command strobe, input this active low signal indicates a write cycle to the part. the cycle may be a write to a control register or a dma register. iochrdy - i/o channel ready, open drain output, 8ma drive this signal is driven low by the part during isa bus cycles in which the part is not able to respond within a minimum cycle time. iochrdy is forced low to extend the current bus cycle. the bus cycle is extended until iochrdy is brought high. drq - dma requests, outputs, 24ma drive these active high outputs are generated when the part is requesting a dma transfer. this signal remains high until all the bytes have been transferred as defined by the current transfer data type. the drq outputs must be connected to 8-bit dma channel request signals only. the defaults on the isa bus are drqa = drq0, drqb = drq1, and drqc = drq3. the defaults can be changed by modifying the hardware resource data. note that drqa is a 5 volt-only pin. when the isa bus is run at 3.3 volts, drqa can either be used with the proper level translator, or drqa can be left unconnected and not used. ds213pp4 cs4237b 98
dack - dma acknowledge, inputs the assertion of these active low signals indicate that the current dma request is being acknowledged and the part will respond by either latching the data present on the data bus (write) or putting data on the bus (read). the dack inputs must be connected to 8-bit dma channel acknowledge lines only. the defaults on the isa bus are dacka = dack0, dackb = dack1, and dackc = dack3. the defaults can be changed by modifying the hardware resource data. irq - host interrupt pins, outputs, 24ma drive these signals are used to notify the host of events which need servicing. they are connected to specific interrupt lines on the isa bus. the irq are individually enabled as per configuration data that is generated during a plug and play configuration sequence. the defaults on the isa bus are irqa = int5, irqb = int7, irqc = int9, irqd = int11, irqe = int12, irqf = int15. the defaults can be changed by modifying the hardware configuration data loaded from the e 2 prom. analog inputs lline - left line input nominally 1 v rms max analog input for the left line channel, centered around vref. a programmable gain block provides volume control and is located in either i18 or x0 based on how synthesis is mapped. lline is typically used for left channel synthesis (fm or wavetab le). rline - right line input nominally 1 v rms max analog input for the right line channel, centered around vref. a programmable gain block provides volume control and is located in either i19 or x1 based on how synthesis is mapped. rline is typically used for right channel synthesis (fm or wavetab le). lmic - left mic input microphone input for the left mic channel, centered around vref. a programmable gain block provides volume control and is located in x2. in mode 3, the output mixer has an extra selectable 20 db of gain controlled by the lmbst bit. rmic - right mic input microphone input for the right mic channel, centered around vref. a programmable gain block provides volume control and is located in x3. in mode 3, the output mixer has an extra selectable 20 db of gain controlled by the rmbst bit. laux1 - left auxiliary #1 input nominally 1 v rms max analog input for the left aux1 channel, centered around vref. a programmable gain block provides volume control and is located in i2. typically used for an external left line-level input. ds213pp4 cs4237b 99
raux1 - right auxiliary #1 input nominally 1 v rms max analog input for the right aux1 channel, centered around vref. a programmable gain block provides volume control and is located in i3. typically used for an external right line-level input. laux2 - left auxiliary #2 input nominally 1 v rms max analog input for the left aux2 channel, centered around vref. a programmable gain block provides volume control and is located in i4. typically used for the left channel cdrom input. raux2 - right auxiliary #2 input nominally 1 v rms max analog input for the right aux2 channel, centered around vref. a programmable gain block provides volume control and is located in i5. typically used for the right channel cdrom input. cmaux2 - common mode auxiliary #2 input common mode ground input for the laux2 and raux2 inputs. typically connected to the cdrom ground input to provide common-mode noise rejection. the impedance on this pin should be one half the impedance on the laux2 and raux2 inputs. min - mono input nominally 1 v rms max analog input, centered around vref, that goes through a programmable gain stage (i26) into both channels of the output mixer. this is a general purpose mono analog input that is normally used to mix the typical "beeper" signal on most computers into the audio system. analog outputs lout - left line level output analog output from the mixer for the left channel. nominally 1 v rms max centered around vref. this pin needs a 1000 pf npo capacitor attached and tied to analog ground. rout - right line level output analog output from the mixer for the right channel. nominally 1 v rms max centered around vref. this pin needs a 1000 pf npo capacitor attached and tied to analog ground. mout - mono output mout is nominally 1 v rms max analog output, centered around vref. this output is a summed analog output from both the left and right output channels of the mixer. mout typically is connected to a speaker driver that drives the internal speaker in most computers. in mode2, mom in i26 mutes both channels going into mout. in mode 3, mom in i26 mutes the left channel and momr in x5 mutes the right channel. ds213pp4 cs4237b 100
midi interface midout - midi out transmit data, output, 4ma drive this output is used to send midi data serially out to a external midi device. normally connected to pin 12 of the joystick connector for use with breakout boxes. midin - midi in receive data, input this input is used to receive serial midi data from an external midi device. this pin should have a 4.7 k w pullup attached and is normally connected to pin 15 of the joystick connector for use with breakout boxes. external fm synthesizer interface scs - synthesizer chip select, output, 4 ma drive by default, scs/ up is an active low output forced low when a valid address decode to an external fm synthesizer, as defined in the plug and play configuration registers, has occurred. when the internal fm synthesizer is enabled, this pin is no longer used as an fm synthesizer chip select. this pin can be used for a hardware volume up pin by setting vcen in the hardware configuration data. sint - synthesizer interrupt, input this pin, xctl1/ sint/ acdcs/ down, defaults to the xctl1 output which is controlled by the xctl1 bit in the wss register i10. if vcen in the hardware configuration data is set, this pin converts to the down volume control function. if vcen is zero, and acdbase is never programmed to a non-zero value, this pin can be changed to sint input by connecting a 10 k w resistor between the xiow pin and sgnd. the polarity of sint can be programmed through ctrlbase+1 register, the ish bit, or the hardware configuration data. sint defaults to an active low input that should be driven by the external fm synthesizer interrupt output pin. this pin can also be configured at a second cdrom chip select, acdcs, to support the alternate ide cdrom decode. (see the cdrom section for more information.) the pin is switched to the cdrom alternate chip select when vcen is zero and the base address is first programmed to non-zero through the e 2 prom data or pnp commands. external peripheral port xd<7:1> - external data bus bits 7 through 1, bi-directional, 4ma drive these pins are used to transfer data between the isa bus and external devices such as the modem and cdrom. these pins are also multiplexed with two serial ports. a dsp serial port can be connected through the xd4-xd1 pins. this interface is multiplexed onto these external data bus pins or the 2nd joystick pins based on the sps (serial port switch) bit. the second serial port connects to the cs9236 single-chip wavetable music synthesizer and uses pins xd7-xd5. this serial port is enabled via the wten bit. both sps and wten are located in either c8 in the control logical device, or the global configuration byte in the e 2 prom hardware configuration data. ds213pp4 cs4237b 101
sda/xd0 - external data bus bit 0/e 2 prom data pin, bi-directional, open drain,4ma sink this open-drain pin must have an external pullup (3.3 k w ) and is used to transfer data between the isa bus bit 0, sd0, and external devices such as a modem or cdrom. sda/xd0 is also used in conjunction with scl/xa0 to access an external serial e 2 prom. when an e 2 prom is used, the sda/xd0 pin should be connected to the data pin of the e 2 prom device and provides a bi-directional data port. the e 2 prom is used to set the plug and play resource data. xctl0/xa2 - xctl0 or external address sa2, output, 4ma drive this pin either outputs isa bus address sa2 or xctl0 depending on the hardware configuration data. the default is xctl0 which is controlled by the xctl0 bit in the wss register i10. this pin changes to address bit xa2 if the hardware configuration data indicates that the peripheral port requires more than four i/o addresses. xa1 - external address, output, 4ma drive this pin outputs isa bus address sa1. xa0/scl - external address, output/serial clock, output, 4ma drive this pin outputs the isa bus address sa0. when e 2 prom access is enabled, via een in ctrlbase+1, then scl is used as a clock output to the e 2 prom. breset - buffered reset, output, 4ma drive this active low signal goes low whenever the resdrv pin goes high. this pin is also software controllable through the bres bit in register c8 in the control logical device space. bres provides a software power down and reset control over devices connected to the crystal codec such as the cs9236 single-chip wavetable music synthesizer. xior - external read strobe, output, 4ma drive (sa12-sa15/cdrom selection) this active low signal goes low whenever ( scs, cdcs, or mcs) and ior goes low. when resdrv goes low, this pin also selects either the cdrom/modem port or sa12 - sa15 and contains an internal pullup of approximately 100 k w . when xior is left high (default), pins 91-94 are sa15-sa12 respectively. to enable the cdrom and modem ports, an external 10k w resistor must be tied between this pin and sgnd. xiow - external write strobe, output, 4ma drive (xctl1/ sint/ acdcs/ down selection) this active low signal goes low whenever ( scs or cdcs or mcs) and iow goes low. when resdrv goes low, this pin also selects either xctl1 or sint and contains an internal pullup of approximately 100 k w . when xiow is left high (default), pin 16 is the xctl1 function (or acdcs, based on a non-zero value being programmed into the alternate cdrom address register). to change the pin to sint, an external 10k w resistor must be tied between this pin and sgnd. ds213pp4 cs4237b 102
joystick/dsp serial port interface jacx, jacy - joystick a coordinates, input these pins and are the x/y coordinates for joystick a. they should have a 5.6nf capacitor to ground and a 2.2k w resistor to the joystick connector pins 3 and 6, respectively. jab1, jab2 - joystick a buttons, input these pins are the switch inputs for joystick a. they should be connected to joystick connector pins 2 and 7, respectively; as well as have a 1nf capacitor to ground, and a 4.7k w pullup resistor. jbcx/sdout - joystick b coordinate x/serial data output, input/output when this pin is used as a second joystick, it is the x coordinates input for joystick b; and should have a 5.6nf capacitor to ground and a 2.2k w resistor to the joystick connector pin 11. when the serial port is enabled, spe = 1 in i16, this pin is the serial data output. the dsp serial port sdout pin can be switched to xd3 via the sps bit. this would facilitate using the dsp serial port and the second joystick simultaneously. jbcy/sdin - joystick b coordinate y/serial data input, input when this pin is used as a second joystick, it is the y coordinates input for joystick b; and should have a 5.6nf capacitor to ground and a 2.2k w resistor to the joystick connector pin 13. when the serial port is enabled, spe = 1 in i16, this pin is the serial data input. the dsp serial port sdin pin can be switched to xd2 via the sps bit. this would facilitate using the dsp serial port and the second joystick simultaneously. jbb1/fsync - joystick b button 1/frame sync, input/output when this pin is used as a second joystick, it is the switch 1 input for joystick b; and should be connected to joystick connector pin 10; as well as have a 1nf capacitor to ground, and a 4.7k w pullup resistor. when the serial port is enabled, spe = 1 in i16, this pin is the serial frame sync output. the dsp serial port fsync pin can be switched to xd4 via the sps bit. this would facilitate using the dsp serial port and the second joystick simultaneously. jbb2/sclk - joystick b button 2/serial clock, input/output when this pin is used as a second joystick, it is the switch 2 input for joystick b; and should be connected to joystick connector pin 14; as well as have a 1nf capacitor to ground, and a 4.7k w pullup resistor. when the serial port is enabled, spe = 1 in i16, this pin is the serial clock output. the dsp serial port sclk pin can be switched to xd1 via the sps bit. this would facilitate using the dsp serial port and the second joystick simultaneously. ds213pp4 cs4237b 103
cs9236 wavetable serial port interface a digital interface to the crystal cs9236 single-chip wavetable music synthesizer is provided that allows the cs9236 pcm audio data to be summed digitally on the crystal codec without the need for an external dac. the wavetable serial port interface pins are multiplexed with the xd7-xd5 external bus pins. this serial port is enabled via the wten bit which is located in the global configuration byte in the e 2 prom hardware configuration data, or c8. the interface typically consists of the three pins listed below as well as: connecting the crystal codec midout pin to the cs9236 midi_in pin, and connecting the crystal codec breset pin to the cs9236 pdn and rst pins. (the bres bit in c8 provides a maximum software power-down mode for the cs9236 by driving the breset signal low whenever bres is set.) sdata - wavetable serial audio data, input this pin is multiplexed with the xd7 external data bus pin. when use as sdata, this input supplies the serial audio pcm data to be digitally mixed to the dacs of the crystal codec. the data consists of left and right channel 16-bit data delineated by lrclk. this pin should be connected to the sout output pin on the cs9236. this pin should also have a weak pull-down resistor of approx. 100 k w to minimize power-down currents and allow for stuffing options. lrclk - wavetable serial left/right clock, input this pin is multiplexed with the xd6 external data bus pin. when use as lrclk, this input supplies the serial data alignment signal that delineates left from right data. this pin should be connected to the lrclk output pin on the cs9236. this pin should also have a weak pull-down resistor of approx. 100 k w to minimize power-down currents and allow for stuffing options. mclk - wavetable master clock, output this pin is multiplexed with the xd5 external data bus pin. when use as mclk, this output supplies the 16.9344 mhz master clock that controls all the timing on the cs9236. this pin should be connected to the mclk5i input pin on the cs9236. mclk can be disabled in software using the dmclk bit in c8 in the control logical device space. dmclk provides a partial software power-down mode for the cs9236. ds213pp4 cs4237b 104
cdrom and modem interface the four cdrom pins are multi-function and default to isa upper address bits sa12-sa15. to enable the cdrom port, an external 10k w resistor must be tied between xior and sgnd. xior is sampled on the falling edge of resdrv. if the cdrom interface doesn?t support dma, the two cdrom dma pins can be converted to support logical device 5, a modem interface. cdcs - cdrom chip select, output, 4ma drive this output goes low whenever an address is decoded that matches the value programmed into the cdrom base address register. acdcs - alternate cdrom chip select, output, 4ma drive this pin, xctl1/ sint/ acdcs/ down, is multiplexed with three other functions, and defaults to the xctl1 output which is controlled by the xctl1 bit in the wss i10. this pin can also be configured at a second cdrom chip select, acdcs, to support the alternate ide cdrom decode. the pin is switched to the cdrom alternate chip select when the base address acdbase is first programmed to non-zero through the e 2 prom data or pnp commands. this output then goes low whenever an address is decoded that matches the value programmed into the cdrom alternate base address register, acdbase. this pin can also be used as the volume up pin down by setting vcen in control register c0 or the hardware configuration data. vcen has the highest precedence over the other pin functions. cdint - cdrom interrupt, input this pin is used to input an interrupt signal from the cdrom interface. the part can be programmed, through the plug-and-play resource data, to output this signal to the appropriate isa bus interrupt line. the polarity if this input can be programmed through ctrlbase+1 register, bit ich, or the hardware configuration data; the default is active high. cdrq/mint - cdrom dma request, or modem interrupt, input this pin can be used to input the dma request signal from the cdrom interface. the part can be programmed, through the plug-and-play resource data, to output this signal to the appropriate isa bus drq line. this pin can also be used to input an interrupt signal from a modem. the pin is switched to mint when the ld5 base address, combase, is first programmed to non-zero through the pnp data or a hostload. the polarity of mint can be programmed through ctrlbase+1 register, imh bit, or the hardware configuration data; the default is active low. cdack/ mcs - cdrom dma acknowledge, or modem chip select, output, 4ma drive this pin can be used to output the isa bus-generated dma acknowledge signal to the cdrom interface. alternately, this pin can be used to output an active low modem chip select, mcs. the pin is switched to the modem chip select when the ld5 base address, combase, is first programmed to non-zero through the pnp data or a hostload. ds213pp4 cs4237b 105
volume control the volume control pins are enabled by setting vcen in the hardware configuration data, misc. hardware config. byte. the vcf1,0 bits in the hardware configuration data, global configuration byte, set the format for the volume control pins. each pin must have an external pullup resistor (10k w ) and either a momentary or toggle style switch based on format. typically a 100 w series resistor and a capacitor to ground, capacitor on the switch side of the series resistor, would be included on each pin for esd protection and to help with emi emissions. up - volume up the scs/ up pin is multiplexed with the external synthesizer chip select. this pin is switched to the up function when vcen is set. when up is low, the master volume output for left and right channels are incremented. down - volume down the xctl1/ sint/ acdcs/ down is a multiplexed pin that can be used as xctl1, the external fm synthesizer interrupt, the alternate cdrom chip select, or the volume down pin. this pin is switched to the down function when vcen is set. when down is low, the master volume output for left and right channels are decremented. mute - volume mute the mute pin function can be toggle, momentary, or non-existent based on the vcf1,0 bits. the mute function is enabled when vcen is set. miscellaneous xtali - crystal input this pin will accept either a crystal, with the other pin attached to xtalo, or an external cmos clock. xtal must have a crystal or clock source attached for proper operation. the crystal frequency must be 16.9344 mhz and designed for fundamental mode, parallel resonance operation. xtalo - crystal output this pin is used for a crystal placed between this pin and xtali. if an external clock is used on xtali, this pin must be left floating with no traces or components connected to it. resdrv - reset drive, input places the part in lowest power consumption mode. all sections of the part are shut down and consuming minimal power. the part is reset and in power down mode when this pin is logic high. the falling edge also latches the state of xior and xiow to determine the functionality of dual mode pins. this signal is typically connected to the isa bus signal resdrv. resdrv must be asserted whenever the part is powered up to initialize the internal registers to a known state. this pin, when high, also drives the breset pin low. ds213pp4 cs4237b 106
vref - voltage reference, output all analog inputs and outputs are centered around vref which is nominally 2.1 volts. this pin may be used to level shift external circuitry, although any ac loads should be buffered. refflt - reference filter, input voltage reference used internal to the part. a 0.1 m f and a 1 m f (must not be bigger than 1 m f) capacitor with short fat traces must be connected to this pin. no other connections should be made to this pin. lfilt - left channel antialias filter input this pin needs a 1000 pf npo capacitor attached and tied to analog ground. rfilt - right channel antialias filter input this pin needs a 1000 pf npo capacitor attached and tied to analog ground. test - test this pin must be tied to ground for proper operation. power supplies va - analog supply voltage supply to the analog section of the codec. agnd - analog ground ground reference to the analog section of the codec. this pin should be placed on an analog ground pin separate from other chip grounds. vd1 - digital supply voltage digital supply for the parallel data bus section of the codec. dgnd1 - digital ground digital ground reference for the parallel data bus section of the part. these pins are isolated from the other grounds and should be connected to the digital ground section of the board (see figure 33). vdf1, vdf2, vdf3, vdf4 - digital filtered supply voltage digital supply for the internal digital section of the codec (except for the parallel data bus). these pins should be filtered, using a ferrite bead, from vd1. sgnd1, sgnd2, sgnd3, sgnd4 - substrate ground substrate ground reference for the codec . these pins are connected to the substrate of the die. optimum layout is achieved by placing sgnd1/2/3/4 on the digital ground plane with the dgnd pin as shown in figure 33. ds213pp4 cs4237b 107
parameter definitions resolution the number of bits in the input words to the dacs, and in the output words in the adcs. differential nonlinearity the worst case deviation from the ideal code width. units in lsb. total dynamic range tdr is the ratio of the rms value of a full scale signal to the lowest obtainable noise floor. it is measured by comparing a full scale signal to the lowest noise floor possible in the codec (i.e. attenuation bits for the dacs at full attenuation). units in db. instantaneous dynamic range idr is the ratio of a full-scale rms signal to the rms noise available at any instant in time, without changing the input gain or output attenuation settings. it is measured using s/(n+d) with a 1 khz, -60 db input signal, with 60 db added to compensate for the small input signal. use of a small input signal reduces the harmonic distortion components to insignificance when compared to the noise. units in db. total harmonic distortion (thd) thd is the ratio of the test signal amplitude to the rms sum of all the in-band harmonics of the test signal. thd is measured using an input signal which is 3db below typical full-scale, and referenced to typical full scale. interchannel isolation the amount of 1 khz signal present on the output of the grounded input channel with 1 khz 0 db signal present on the other channel. units in db. interchannel gain mismatch for the adcs, the difference in input voltage that generates the full scale code for each channel. for the dacs, the difference in output voltages for each channel with a full scale digital input. units in db. offset error for the adcs, the deviation in lsbs of the output from mid-scale with the selected input grounded. for the dacs, the deviation in volts of the output from vref with mid-scale input code. ds213pp4 cs4237b 108
package parameters d d1 e e1 e1 b 100 1 n a a1 b c d d1 e e1 e1 100-pin tqfp - package code 'q' l1 t symbol description lead count overall height stand off lead width lead thickness terminal dimension package body terminal dimension package body lead pitch foot length lead angle min nom max 0.077 100 0.00 0.14 15.70 15.70 0.40 0.30 0.0 12.0 0.20 0.127 16.00 14.0 16.00 14.0 0.50 0.50 1.66 0.26 0.177 16.30 16.30 0.60 0.70 a1 a c l1 t notes: 1) dimensions in millimeters. 2) package body dimensions do not include mold protrusion, which is 0.25 mm. 3) coplanarity is 0.004 in. 4) lead frame material is al-42 or copper, and lead finish is solder plate. 5) pin 1 identification may be either ink dot or dimple. 6) package top dimensions can be smaller than bottom dimensions by 0.20 mm. 7) the "lead width with plating" dimension does not include a total allowable dambar protrusion of 0.08 mm (at maximum material condition). 8) ejector pin marks in molding are present on every package. ds213pp4 cs4237b 109
appendix a: typical motherboard e 2 prom data ; eeprom validation bytes db 055h, 0bbh ; eeprom validation bytes: cs4237b db 001h ; eeprom data length upper byte db 00fh ; lower byte, listed size = 271 ; hardware configuration data db 000h ; acdbase addr. mask length = 1 bytes db 003h ; combase addr. mask length = 4 bytes db 080h ; mcb: ihcd db 080h ; gcb1: ifm db 00bh ; code base byte db 020h ; reserved db 004h ; reserved db 008h ; reserved db 010h ; reserved db 080h ; reserved db 000h ; reserved db 000h ; reserved ; hardware mapping data db 000h ; 00=4/08=8 peripheral port size, xctl0/xa2 db 048h ; reserved db 075h ; irq selection a & b - b= 7, a=5 db 0b9h ; irq selection c & d - d=11, c=9 db 0fch ; irq selection e & f - f=15, e=12 db 010h ; dma selection a & b - b= 1, a=0 db 003h ; dma selection c - c=3 ; pnp resource header - pnp id for cs4237b ic, oem id = 42 db 00eh, 063h, 042h, 037h, 0ffh,0ffh,0ffh,0ffh,030h ; csc4237 ffffffff db 00ah, 010h, 001h ; pnp version 1.0, vender version 0.1 db 082h, 009h, 000h, cmb4237b, 000h ; ansi id ; logical device 0 (windows sound system & sbpro) db 015h, 00eh, 063h, 000h, 000h, 000h ; eisa id: csc0000 db 082h, 007h, 000h, wss/sb, 000h ; ansi id db 031h, 000h ; df best choice db 02ah, 002h, 028h ; dma: 1 - wss & sbpro db 02ah, 009h, 028h ; dma: 0,3 - wss & sbpro capture db 022h, 020h, 000h ; irq: 5 interrupt select 0 db 047h, 001h, 034h, 005h, 034h, 005h, 004h, 004h ;16b wssbase: 534 db 047h, 001h, 088h, 003h, 088h, 003h, 008h, 004h ;16b synbase: 388 db 047h, 001h, 020h, 002h, 020h, 002h, 020h, 010h ;16b sbbase: 220 db 031h, 001h ; df acceptable choice 1 db 02ah, 00ah, 028h ; dma: 1,3 - wss & sbpro db 02ah, 00bh, 028h ; dma: 0,1,3 - wss & sbpro capture db 022h, 0a0h, 09ah ; irq: 5,7,9,11,12,15 interrupt select 0 ds213pp4 cs4237b 110
db 047h, 001h, 034h, 005h, 0fch, 00fh, 004h, 004h ;16b wssbase: 534-ffc db 047h, 001h, 088h, 003h, 088h, 003h, 008h, 004h ;16b synbase: 388 db 047h, 001h, 020h, 002h, 060h, 002h, 020h, 010h ;16b sbbase: 220-260 db 031h, 002h ; df suboptimal choice 1 db 02ah, 00bh, 028h ; dma: 0,1,3 - wss & sbpro db 022h, 0a0h, 09ah ; irq: 5,7,9,11,12,15 interrupt select 0 db 047h, 001h, 034h, 005h, 0fch, 00fh, 004h, 004h ;16b wssbase: 534-ffc db 047h, 001h, 088h, 003h, 0f8h, 003h, 008h, 004h ;16b synbase: 388-3f8 db 047h, 001h, 020h, 002h, 000h, 003h, 020h, 010h ;16b sbbase: 220-300 db 038h ; end of df for logical device 0 ; logical device 1 (game port) db 015h, 00eh, 063h, 000h, 001h, 000h ; eisa id: csc0001 db 082h, 005h, 000h, game, 000h ; ansi id db 031h, 000h ; df best choice db 047h, 001h, 000h, 002h, 000h, 002h, 008h, 008h ;16b gamebase: 200 db 031h, 001h ; df acceptable choice 1 db 047h, 001h, 008h, 002h, 008h, 002h, 008h, 008h ;16b gamebase: 208 db 038h ; end of df for logical device 1 ; logical device 2 (control) db 015h, 00eh, 063h, 000h, 010h, 000h ; eisa id: csc0010 db 082h, 005h, 000h, ctrl, 000h ; ansi id db 047h, 001h, 020h, 001h, 0f8h, 00fh, 008h, 008h ;16b ctrlbase: 120-ff8 ; logical device 3 (mpu-401) db 015h, 00eh, 063h, 000h, 003h, 000h ; eisa id: csc0003 db 082h, 004h, 000h, mpu, 000h ; ansi id db 031h, 000h ; df best choice db 022h, 000h, 002h ; irq: 9 interrupt select 0 db 047h, 001h, 030h, 003h, 030h, 003h, 008h, 002h ;16b mpubase: 330 db 031h, 001h ; df acceptable choice 1 db 022h, 000h, 09ah ; irq: 9,11,12,15 interrupt select 0 db 047h, 001h, 030h, 003h, 060h, 003h, 008h, 002h ;16b mpubase: 330-360 db 031h, 002h ; df suboptimal choice 1 db 047h, 001h, 030h, 003h, 0e0h, 003h, 008h, 002h ;16b mpubase: 330-3e0 db 038h ; end of df for logical device 3 db 079h, 09fh ; end of resource data, checksum ds213pp4 cs4237b 111
appendix b: differences between the cs4236 and the cs4237b this part is designed to be hardware and software backwards compatible with the cs4236 and will drop into an existing cs4236 socket without any hardware modifications. properly written code for the cs4236 will run on the this codec. however, the cs4237b has enhancements over the cs4236 that provide extra functionality. the differences are as follows: 1. ctrlbase+3 is redefined to be an indirect address register and ctrlbase+4 is redefined to be an indirect data register. these registers allows access to c0 through c8 indirect registers. 2. cdsdd in the global configuration byte of the hardware configuration data has been renamed sdd and its function expanded. on this part, setting sdd disables peripheral port reads from driv- ing the isa data bus for all peripheral port devices, e.g. cdrom and modem. on the cs4236, setting cdsdd disables peripheral port reads for the cdrom device only. 3. the serial port works continuously once enabled. cen and pen do not have any effect on the se- rial port. on the cs4236, cen and pen disabled their respective part of the serial port when set to zero. 4. the game logical device (joystick) only aliases from gamebase+0 to gamebase+5. game- base+6 and gamebase+7 are reserved. this codec also contains support for digital assist of analog joysticks to support the microsoft direct input initiative. 5. i25 was defined as a version and chip id register in the cs4236. this register is now redefined as a compatibility register and is identical to the cs4236 to allow software written to the cs4236 to work properly on this part. the version and chip id for this chip has been moved to control indi- rect register c1 and wss indirect register x25 (revision c or greater). 6. i27 and i29 in the wss space are reserved. 7. when ifm is enabled (and remapping is enabled) i18/i19 return the same value written when mute is enabled. on the cs4236, i18/19 returns 0xbf when mute is enabled. 8 the olb bit in i16 is no longer functional and internally is set as if olb is on. 9. the mic input impedance is now 8 k w minimum. ds213pp4 cs4237b 112
the added features over the cs4236 are as follows: 10. srs 3d sound technology is added and is controlled through c2 and c3 registers. 11. a wavetable serial port interface is added for connection to the cs9236 single-chip wavetable music synthesizer. the pins are multiplexed with the xd7-xd5 pins and are controlled by the wten bit in c8 or the global configuration byte in the hardware configuration data. 12. the dsp serial port can be multiplexed to the xd4-xd1 pins to allow the dsp serial port and the second joystick to be used simultaneously. the multiplexing is controlled by the sps bit in c8 or the global configuration byte in the hardware configuration data. 13. hardware volume control supports 4 formats. 14. new bits are added to the global configuration byte of the hardware configuration data: vcf1 and vcf0 hardware volume control format bits slad which disables sound blaster synthesis volume changes from affecting line volume. wten to enable the wavetable serial port sps to switch the dsp serial port pins from the second joystick to the xd4-xd1 pins 15. the consumer digital audio transmission format supported on the dsp serial port through the c4- c6 registers is new. 16. serial port format 3 (i16) is a new dsp serial port format. 17. a symmetrical mixer (the input mixer is new) is included and is supported by a new mode, mode 3. this mode is enabled by setting the cms1,0 bits in wss i12 to 11. note that the cs4236 mode2 bit has been renamed cms1 (codec mode select 1). cms1 is backwards compat- ible with the cs4236 mode2 bit. 18. the mic can be mixed directly to the output mixer with full volume control. 19. hardware configuration byte 9 was reserved in the cs4236 (at 0x43) and is now used as a code base byte that determines the firmware code compatibility in the e 2 prom. when firmware code for this part is loaded in the e 2 prom this byte must be changed to 0x0b. this provides backwards compatibility by ignoring cs4236-based firmware code, which has this byte set to 0x43, while still reading the hardware configuration and pnp data from cs4236-programmed e 2 prom. 20. 3.3 volt isa bus support is added. this includes all isa pins except drqa (which still runs at 5 volts). when the vd1 pin is powered from a 3.3 volt supply, the isa bus connected to it must also run at 3.3 volts. ds213pp4 cs4237b 113


▲Up To Search▲   

 
Price & Availability of CS4237B-KQ

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X